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
{{ message }}
Repository navigation
[BUG] useFieldArray fields empty on second visit when using useForm #7401
useFieldArray.fields is empty when navigating back to an edit form that uses useForm in a SPA. On the first visit the fields populate correctly, but on every subsequent visit they do not.
I can reproduce this on my end. The issue is that applyValuesToFields() misses useFieldArray fields because they register after the microtask runs. Using reset() instead handles field arrays natively through RHF. Working on a PR.
I’ll investigate the useFieldArray empty-on-second-visit behavior in @refinedev/react-hook-form, reproduce it with a focused test case, and open a PR with a fix once I’ve isolated the root cause.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
zons-zhaozhy commentedon May 11, 2026
I can reproduce this on my end. The issue is that applyValuesToFields() misses useFieldArray fields because they register after the microtask runs. Using reset() instead handles field arrays natively through RHF. Working on a PR.
fix(react-hook-form): initialize useFieldArray via reset on first dat…
OfficialRohitSharma442 commentedon Jun 5, 2026
I am looking into this
swayamshah01 commentedon Jun 5, 2026
Hi, I’d like to take this up.
I’ll investigate the
useFieldArrayempty-on-second-visit behavior in@refinedev/react-hook-form, reproduce it with a focused test case, and open a PR with a fix once I’ve isolated the root cause.Nexus334023K commentedon Jun 12, 2026
Can i try ??
fix(react-hook-form): initialize useFieldArray via reset on first dat…
fix(react-hook-form): initialize useFieldArray via reset on first dat…
stale commentedon Aug 12, 2026
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.