Replies: 3 comments 2 replies
-
You might find this issue relevant: #6243. |
Beta Was this translation helpful? Give feedback.
1 reply
-
answered here: #6243 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
-
@zyasir did you ever find a solution here? To avoid constant re-renders, I am currently using |
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
-
Is there a way to getFormState? Similar to getValues?
Here's a codesandbox demo- https://codesandbox.io/s/interesting-solomon-jbql4?file=/src/App.js:511-553
And here is video of me demoing the codesandbox -
Screen.Recording.2021-09-17.at.8.09.21.AM.mov
You'll notice that once you focus the text input then unfocus it, it shows "Field is dirty". But then when you click submit, it logs field is not dirty.
To make this example work you have too uncomment that line above so that
isDirty
is accessed in render of where submit handler is made (app level). But this will cause it to re-render the app. I just want to access latest form state in a callback.Is this possible?
Beta Was this translation helpful? Give feedback.
All reactions