You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an application that I am creating, I have a style for a text type input field (using styled-components)... in order to avoid copying these styles in every part of my code I created a component... when using this input field on a form i see that the touchedFields property works correctly, but the dirtyFields property doesn't work.
In the link below you will find what I have implemented in my application, you can see two inputs of text type, one using the component created by me and the other is not stylized. Here you can see that the touchedFields property works in both of them and only in one of them does the dirtyFields property work.
What am I doing wrong??
Please be as clear as possible in your answer, as I have little programming experience.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
In an application that I am creating, I have a style for a text type input field (using styled-components)... in order to avoid copying these styles in every part of my code I created a component... when using this input field on a form i see that the touchedFields property works correctly, but the dirtyFields property doesn't work.
In the link below you will find what I have implemented in my application, you can see two inputs of text type, one using the component created by me and the other is not stylized. Here you can see that the touchedFields property works in both of them and only in one of them does the dirtyFields property work.
What am I doing wrong??
Please be as clear as possible in your answer, as I have little programming experience.
https://codesandbox.io/s/react-hook-form-isdirty-r2rff2?file=/src/App.tsx:931-940
Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions