Skip to content

How to resolve warning: Can only update a mounted or mounting component for Array #21

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

Closed
kavink opened this issue Feb 17, 2018 · 6 comments

Comments

@kavink
Copy link

kavink commented Feb 17, 2018

Any thoughts on how I can resolve this ? The FieldArray field is just function. And using that in my form.

 Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.

Please check the code for the ReactFinalFormFieldArray(4.2.0)(undefined) component.

@heikki
Copy link

heikki commented Feb 19, 2018

Same problem here. I haven't been able to reproduce it in a simple example.
It happens only when there's a validation in field array field and it seems to originate from a setTimeout call here:

setTimeout(() => this.setState({ state }))

@kavink
Copy link
Author

kavink commented Feb 19, 2018

@heikki Yes , it also causes performance impact as mentioned in #22

@erikras
Copy link
Member

erikras commented Feb 19, 2018

@kavink
Copy link
Author

kavink commented Feb 19, 2018

@Erikas a small snippet on how to do Woolf be great , I’m assuming I should check for my full form or just array fields ? Thanks !

@heikki
Copy link

heikki commented Feb 23, 2018

Great! Fix seems to work. Can we get a new release or is it waiting for something else?

@erikras
Copy link
Member

erikras commented Feb 23, 2018

Published fix in v1.0.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants