jcmcneal / react-step-wizard

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

Pass data when step changes #61

Closed robvenn closed 4 years ago

robvenn commented 4 years ago

Maybe I''m missing something but I guess this is a feature request, would it be possible to pass data to the onStepChange handler? Especially when going to the next step this would really help for a lot of functionalities that can be built with this I think, like one example where user has to enter data on some of the steps and the parent component can use this to update state, or do you have better suggestions? This could also maybe change the steps as you are going through it depending on which data is entered.

Pautomagi commented 4 years ago

I believe what you are asking is supported. See the example code, https://github.com/jcmcneal/react-step-wizard/tree/master/app

You can keep data in the parent state and pass it as props to other steps if thats what you are asking?

robvenn commented 4 years ago

@Pautomagi alright thanks for the info! Just fyi the npm scripts don't seem to work on Windows, but looking at the example code in the app.js did give me some examples to work around this... So I will close the ticket.