Next.js Discord

Discord Forum

Only able to put one character in the field

Unanswered
Flemish Giant posted this in #help-forum
Open in Discord
Flemish GiantOP
in all the field only able to put one character at a time can anyone help me here

1 Reply

This component is massive so I'd recommend refactoring it so it's a bit easier to read. (Is it also redundant to have two validations, one in the checkField() function and another written in RHF? You can test/validate only dirty/touched fields in RHF I think, they have examples of multi-page forms.

Anyway, an initial sniff, I think it's because of the watch - it triggers a re-render on every input change so I would remove that, if needed, use the useWatch hook.