Difference between setValue and onChange when applying input mask with react-hook-form in React Native #11926
Unanswered
BarbieriMatheus
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using react-hook-form to manage a form in React Native and applying a custom phone mask to an input field. I have a question about the necessity of using setValue along with onChange.
Here is a simplified example of my code:
My Question:
What happens if I use only onChange to update the input value and do not call setValue? Will the final result be the same?
Below is the modified version without setValue:
I would like to better understand the difference and practical implications of using setValue along with onChange versus using only onChange.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions