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
I'm running into issues using useFieldArray. This example here https://github.com/refinedev/refine/tree/master/examples/blog-react-hook-dynamic-form has the same bug: when you go from the list to the edit page of a record you can see the skills in the form, but when you then route to the list page and back to the record edit page the skills have disappeared
Hey @doender, just opened up a PR #5903 to fix this issue in our blog-react-hook-dynamic-form.
We're using setValue from useForm of react-hook-form internally in our useForm of @refinedev/react-hook-form to set values per registered field of a record. This does not trigger a re-render and results in outdated display of the array field. Check out the related issue from react-hook-form here react-hook-form/react-hook-form#1564
The advised workaround was to use useWatch or watch to properly rendering the field. In #5903 I did the same, you can check it out to help you resolve issue on your project! 🚀
Describe the bug
I'm running into issues using
useFieldArray
. This example here https://github.com/refinedev/refine/tree/master/examples/blog-react-hook-dynamic-form has the same bug: when you go from the list to the edit page of a record you can see the skills in the form, but when you then route to the list page and back to the record edit page the skills have disappearedSteps To Reproduce
Expected behavior
The fields are shown
Packages
See the example
Additional Context
No response
The text was updated successfully, but these errors were encountered: