- From the Store we could save our data in a central location and rerender just the components that listened to changes to that data .
- I thought a good example of showcasing this ability would be in a multi-step registration where we update a component’s state to show which step the user is on, then show the fields for that step .
- When the user goes to the next step in the process, we’ll increase the step state by 1.
- React will see the change to our step state and automatically rerender the component to show exactly what we want the user to.
- And since on step 2 of the process we’ll have been able to go back to a previous step, we’ll have to create a previousStep too.
Read the full article, click here.
@viget: “Building a Multi-Step Registration Form with React by @tommyjmarshall #reactjs”
A simple React example of showcasing a multi-step registration where using state can determine what’s rendered.
Building a Multi-Step Registration Form with React