Function 'onChangePhoneNumber' is called with empty value every time component is rendered even with defaultValue #24
Replies: 1 comment 1 reply
-
hey @victorgoecking I tried to reproduce your situation using the example on README with React-Hook-Form + Typescript + Default Phone Number Value and the input value dont stay empty after rerender... Can you deploy this code anywhere? Maybe, I (or another) can help you... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using "React-Hook-Form + Typescript + Default Phone Number Value". I receive the api data already passed to the hook-form's defaultValue and also passing the "value" and "defaultValue="+5500999999999" in the , but when the component is rendered it calls the "onChangePhoneNumber" function defining the value as empty.
I'm using a small strategy to check if it's the first rendering so as not to set an empty value.

What could I be doing wrong?

Beta Was this translation helpful? Give feedback.
All reactions