Build a three-step wizard as a single React component: Account (email + password), Profile (name + role), then a read-only Review with a Submit button. A progress bar and a "Step X of 3" label track where you are, Next validates the current step before advancing, and Back returns without validating — all while keeping the data the user has already typed.
The starter App.tsx renders step 1 in its resting state. Make the wizard work:
step (1–3) and a single form object holding every field across all steps, plus an errors object.value to form so switching steps never loses data.Next. On Next, validate the current step's required fields. If it fails, show inline errors and stay; if it passes, advance.Back is free. It steps backward with no validation.Submit shows a "Submitted!" success state.Next shows "Email is required" and the step does not change.Next to reach Profile, click Back — the email and password you typed are still there.Submit replaces the form with the success message and fills all three progress segments.form object, not a separate useState per field — it makes "preserve data across steps" automatic.step; only the visible step's fields are checked.errors is derived on demand (computed in next()), not a field you keep permanently in sync.styles.css; focus on the state and flow.