react-hook-form: How to force lowercase characters
I want to accept a username that only consists of lowercase characters
8 Replies
GitHub
TypeScript-first schema validation with static type inference
TypeScript-first schema validation with static type inference
hi, thank you, but wouldn't it be nicer if every character you type into the input is automatically the lowercase version?
also works, i was just giving a solution
you can use rhf with watch, a effect, getValue, and setValue
ohh
that's nice
thank you
Solution
watch('field') to listen to changes
in a effect to run
getValue to get the current value
setValue as the value with lowercase stuff
thank you, I will try it out