Closed Hopp3r closed 4 years ago
If you change the steps
value it will reset the form values. Closing as this is not related to the library itself but an use case that would be better asked on Stack Overflow.
@zaguiini What do you mean change the steps value?
a code example would be nice, i was never able to figure this out
@Hopp3r I got it. Just create a state for your steps and tie the steps
property of the wizard to it. Then, you'll just need to set the state in order to reset the form values.
@zaguiini Changing the steps doesn't reset the form. I tried that. It resets the form values, of course, but the wizard remains at the last step. And, there's no function to go to the first step, is that right?
Yes, that's probably correct as it's not really a common case. It's actually possible to go to a specific step if you pass the correct albusProps
.
@zaguiini Well, in fact, the only scenario I can think of, in which you don't want to reset the form, is a sign-up wizard. So, I would say having to reset the form is very common.
I saw the go()
method of albusProps
. It doesn't work after the form is submitted. I'm going to try it, at the time the steps are loaded.
@zaguiini I want to reset the form on submit. I use setValues from useFormikWizard, but now that data persists even upon submitting my form. How do I clear my values for the next use of the wizard?
Specifically doing something like this persists, even after submit. The next time I open the wizard, tableData is populated with my old lineitems data.