-
-
Notifications
You must be signed in to change notification settings - Fork 71
FieldArray re-renders even if the subscription prop is set, the subscription prop is ignored #93
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
Comments
Is there any update on this issue? This behavior causes huge performance drop in our application. |
yes you can wrap the FieldArray component with React.memo and compare the props in the comperator like this
|
@erikras When are you planning on releasing a new version for this? This change pretty much mitigates the performance issue I'm struggling with. Since there is a close deadline when we I'm expected to fix this, my options are:
Can you give a ballpark estimation on when you will release this fix on npm? It would really help me to estimate my workload. |
Published fix in |
Thats even better than an estimation, thanks! 😄 |
Bug report
What is the current behavior?
FieldArray re-renders on any Field event even when the FieldArray subscription={{}} prop is set, seems like the subscription prop is ignored.
This happens when using react-final-form-arrays 3 and react-final-form 6
when I downgrade to react-final-form-arrays 2 and react-final-form 4 everything works as expected
What is the expected behavior?
FieldArray should not re-render on Field change event when the subscription prop is set to {{}}
Sandbox Link
https://codesandbox.io/embed/react-final-form-field-arrays-mblll
What's your environment?
Other information
Use the linked sandbox and see the console log comment that runs in the FieldArray component when the FieldArray re-renders on each key type in any FieldArray input. Than downgrade to react-final-form-arrays 2 and react-final-form 4 and the log will print only when the FieldArray mounts and not on every key press in the input field
The text was updated successfully, but these errors were encountered: