React-redux-form: Can you use this to create a wizard (multi-step) form?

Created on 24 Mar 2017  路  7Comments  路  Source: davidkpiano/react-redux-form

I was looking at this and was wondering if you can create multi-step forms with it? Is that something you have support for?

question

Most helpful comment

Awesome! Feel free to share the code here too, would be great for others to learn from.

All 7 comments

Yes! It's one of the biggest reasons that you would implement forms with Redux in the first place.

What specifically do you need help with?

Do you have an example showing that? Just want to see how to show steps and see if you can do two things:

  1. Allow branching (if you choose answer A, we go down one path. Answer B down another)

  2. Can I inject steps dynamically (if we make an API call, can I use the results from that to add additional steps into the form?

Allow branching (if you choose answer A, we go down one path. Answer B down another)

How would you solve this in React? Using React-Router/etc? That's the same solution that you would use.

Can I inject steps dynamically (if we make an API call, can I use the results from that to add additional steps into the form?

Yes, of course:

// in render()
const models = ['foo', 'bar', 'baz'];

return (<div>
  {models.map(model => <Control.text model={`user.${model}`) />}
</div>);

Thanks @davidkpiano . That helps a lot. Is there an example showing how to make a wizard? Like showing one step at a time with a next button?

Nevermind, I figured it out. Thanks again

Awesome! Feel free to share the code here too, would be great for others to learn from.

@tchristian32 do you have an example that you can post?

Was this page helpful?
0 / 5 - 0 ratings