jcmcneal / react-step-wizard

A modern flexible step wizard component built for React.
MIT License
583 stars 126 forks source link

transfer props from one step to another on goTostep() #69

Closed morelgarisi closed 4 years ago

morelgarisi commented 4 years ago

is it possible to transfer data from one step to the other?

resolritter commented 4 years ago

It's possible to keep the state between different steps by synchronizing them in a parent component. For instance, formik-wizard does this by sharing the steps' state in Formik's context.

Currently its implementation is based on react-albus, but the creator of that library has announced here that he's working on a new version which could support react-step-wizard.

jcmcneal commented 4 years ago

I agree with @resolritter, you'll want to manage state outside of the step wizard. I have a basic example of that in this repo but there are a lot of solutions like Redux or React Context that you can use to accomplish the same thing.