generated from jphacks/JP_sample
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segmentedControlを作成する #63
Comments
各stepで、procedureに追加する形でstateを管理するようにする |
バケツリレーになっているのがこいつら // 折り方選択で、現在のステップを保持する変数
const [inputStep, setInputStep] = useState<Step>("axis");
const [procedureIndex, setProcedureIndex] = useState(1);
// 各procedureでの、最終的に必要な情報を保持する変数
const [origamiDescription, setOrigamiDescription] = useState("");
const [fixBoards, setFixBoards] = useState<Board[]>([initialBoard]);
const [moveBoards, setMoveBoards] = useState<Board[]>([]);
const [foldingAngle, setFoldingAngle] = useState(180);
// rotateAxisも必要
// 最終的に保存したい情報を保持する変数。
const [procedure, setProcedure] = useState<Procedure>({
"1": {
description: "",
fixBoards: [],
moveBoards: [],
rotateAxis: [],
},
}); |
こいつらを、procedureという一つで管理できたらいい。 |
procedure一つで管理するためには? まずこいつら // 折り方選択で、現在のステップを保持する変数
const [inputStep, setInputStep] = useState<Step>("axis");
const [procedureIndex, setProcedureIndex] = useState(1);
ちょっと面倒なのが、 だから、それらの変数も同時に管理しておいて、保存の時だけfilterするようにするのが一番わかりやすいよね |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: