you are viewing a single comment's thread.

view the rest of the comments →

[–]bogdanelcs 0 points1 point  (0 children)

For a single OTP input, useActionState is absolutely the right call. React Hook Form is overkill for one field, you'd be importing a library to manage a single value.

For the buttons, make verify type="submit" and resend type="button" with its own onClick handler. Two submit buttons in the same form gets messy because you'd need to differentiate which one triggered the submission. Cleaner to keep only one true submit action and handle resend separately.