4 ms·
"Look, it can render the whole app really quickly every time the user presses a key!"
by tobyhinloopen 1y ago
"Look, it can render the whole app really quickly every time the user presses a key!"
- PaulHoule 1y agoThat 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/ https://react-hook-form.com/ which has a rational answer to the problems that turn up with uncontrolled forms.
- tobyhinloopen 1y agoThat's neat, thanks for the link!