-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dashboard): don't use defaultValues for async content #7187
fix(dashboard): don't use defaultValues for async content #7187
Conversation
defaultValues, | ||
values: { | ||
...defaultValues, | ||
...step.controls.values, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to some posts values
should be used for values that depend on async return and defaultValues
on static fields, but the react-hook-form docs states various other things, quite confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I am not sure I understand the fix. If it works it works but I suggest adding a comment in the code.
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
defaultValues, | ||
values: { | ||
...defaultValues, | ||
...step.controls.values, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I am not sure I understand the fix. If it works it works but I suggest adding a comment in the code.
What changed? Why was the change needed?
Details: https://linear.app/novu/issue/NV-4941/step-form-values-are-not-being-properly-updated-after-revisiting
form_fields_bug.mp4