Comment by PaulHoule

4 days ago

That gets into a very interesting question of controlled vs. uncontrolled components.

On one hand I like controlled components because there is a single source of truth for the data (a useState()) somewhere in the app, but you are forced to re-render for each keypress. With uncontrolled components on the other hand, there's the possible anarchy of having state in React and in the actual form.

I really like this library

https://react-hook-form.com/

which has a rational answer to the problems that turn up with uncontrolled forms.