issue: update from useFieldArray causes a different id being generated #10811
-
Version Number7.45.4 Codesandbox/Expo snackhttps://codesandbox.io/s/usefieldarray-with-preview-forked-wjrwm6?file=/src/App.js Steps to reproduce
Expected behaviourThe submit function is supposed to set So instead of re-render of one instance, we get a completely different instance of the component. Hence all the state from within the first component instance is lost. That will include all the items from within formState of the child form in What browsers are you seeing the problem on?Chrome Relevant log outputNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
This is expected behaviour for |
Beta Was this translation helpful? Give feedback.
-
@bluebill1049 thanks for your response. Are there any potential problems with using a custom ids (from within our db) for keys of the field components? Is there a strong technical reason why the |
Beta Was this translation helpful? Give feedback.
-
Yes, we need to unmount and remount the component to render the updated input value. |
Beta Was this translation helpful? Give feedback.
Yes, we need to unmount and remount the component to render the updated input value.