-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resetting a multi-step form causes an error #382
Comments
Leaving the code here in case the sandbox gets reset as I'm not familiar with it
|
Please note that I'm using one version earlier than the latest. Basically I have a multistep form which can loop in step flow until the user decided not to. So I'd like reset the form every time the user finishes the last step. |
Hi @joepuzzo - just bumping this up in case you've missed it. Please take a look at this if you can, thank you! |
Hey sorry I totally did miss this. Will look into it! |
Ok soo I need time to think about this because technically you are trying to perform reset on fields that are not on screen so that is an issue |
@joepuzzo thanks for looking into this! Yeah I realized that too. I realize that it's technically not possible, so would probably need refactoring of how multi-step works and renders I assume? |
@joepuzzo if the problem is that the fields aren't currently in the DOM, can we rather show/hide the fields using CSS? that way all the fields are in the DOM and we can reset them as required. Do you see any pitfalls in changing the way multistep works to this way? |
informed is not a dom library it is a react library. This would not work in native. |
Ah right, my bad. Is a solution even technically possible without doing a refactor of how multistep works in that case @joepuzzo? |
It may require significant code changes. I would reccomend maybe creating your own multistep for now and I will think on this. |
Thanks for your response, appreciate it. |
Describe the bug
Trying to reset a multi-step form causes the error -
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. asField/forwardRef<@webpack-internal:///./node_modules/informed/dist/esm/index.js:2097:29
To Reproduce
https://codesandbox.io/embed/informed-multistep-reset-weeyx
The text was updated successfully, but these errors were encountered: