reset "the first onBlur" event of " mode: onTouch" after calling reset() #3458
-
Hi Bill, thanks for the excellent library. I really love it. I'm not sure if this's a bug or not and I decided to create a discussion. I'm curious about the reset function. This's my current configs: const { reset } = useForm({
mode: 'onTouch',
shouldFocusError: true,
}) after a successful submission, I called My situation is I'd like to render an icon as suffix of my input, this is the logic errors[fieldName] ? <IconX /> : formState.touched[fieldName] ? <IconCheck> : undefined this input is registered with a |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
hey buddy, any chance you can share a codesandbox for what you try to achieve? |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the quick reply.
|
Beta Was this translation helpful? Give feedback.
-
hey, take a look at the codesandbox, it's correct to call reset at useEffect: https://codesandbox.io/s/reproduce-react-hook-form-forked-tqs9u?file=/src/App.js there is a CSB with submit reset: https://react-hook-form.com/api#reset |
Beta Was this translation helpful? Give feedback.
hey, take a look at the codesandbox, it's correct to call reset at useEffect: https://codesandbox.io/s/reproduce-react-hook-form-forked-tqs9u?file=/src/App.js
there is a CSB with submit reset: https://react-hook-form.com/api#reset