Resetting Controlled Components in Forms
Published 📅: ....
Last modified 📝: ....
Share this post on BlueskySee discussion on Bluesky
If you're starting to leverage some of React's form primitives (e.g. action / formAction and Server Actions), you might run into the same conundrum I did with controlled components.
By default, React will reset a form after a submission , however that doesn't really do much to components that manage their own state, the state managed by React will be preserved on the form submit.