Form data reset in <input /> tags
I have the following form:
I want the data that the user inputs in the "input" tag fields to reset when the user leaves the page or submits the form. How do i do that?
2 Replies
the solution i came up with is the following: i bound each <input /> to a respective model, and i reset the model before the component gets unmounted:
The question is: Is this a good practice and is there a better way to achieve the same result?
I don’t think that’s necessary if the component is being unmounted. The state is going to be lost anyway
Are you experiencing any particular issue?