Enforce validation #9319
Replies: 1 comment
-
It's uncontrolled vs controlled inputs trade-off. The former has it's performance benefits as the source of truth for the input's value is the input. The trade-off is you can't "tell" the input it's value (format / manipulate value). If you need to do so, you want the controlled input API ( In regards to boilerplate, it depends on how you've setup your components / App. You can create a reusable input with In regards to uncontrolled inputs and the RHF benefits, the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I have an input with a maxLength: 25 rule for example, there should also be an option to not allow new characters into the input until there is less than 25. Right now to be able to do that you have to use the Controller component and that breaks the efficiency of using react hook form. If I have a form with 20 different inputs, I have to have 20 different Controllers with all the boilerplate code just so I can pass it a custom onChange function? Thats not really nice
Beta Was this translation helpful? Give feedback.
All reactions