@MateuszSobiech
Posted
Hi, good work. Consider to change state from booleans to number or string. I think it might simplify the code.
const [stepOne, setStepOne] = useState(true);
const [stepTwo, setStepTwo] = useState(false);
const [stepThree, setStepThree] = useState(false);
const [stepFour, setStepFour] = useState(false);
type StepState = 1 | 2 | 3 | 4;
const [step, setStep] = useState<StepState>(1);
switch(step) { ... }
Marked as helpful
@SvitlanaSuslenkova
Posted
@MateuszSobiech thanks, that's a good idea :)