Skip to content
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

Console warning: forcedUpdate #1

Closed
t1mmen opened this issue Aug 4, 2015 · 2 comments
Closed

Console warning: forcedUpdate #1

t1mmen opened this issue Aug 4, 2015 · 2 comments

Comments

@t1mmen
Copy link

t1mmen commented Aug 4, 2015

Hi,

Thanks for this component! I'm having a slight issue when navigating away from pages using this component, with the console giving me the following warning:

Warning: forceUpdate(...): Can only update a mounted or mounting component. This usually means you called forceUpdate() on an unmounted component. This is a no-op.
@t1mmen
Copy link
Author

t1mmen commented Aug 4, 2015

I've tried removing the forcedUpdate call in the componentWillRecieveProps hook, which fixed the warnings issue. Everything still appears to be working as expected, but I'm thinking you probably had a good reason to put this call in?

@eiriklv
Copy link
Owner

eiriklv commented Aug 5, 2015

Hi @t1mmen! There's a reason for it (there's some quirks when you use infinite scrolling/reloading of entire collections in certain cases). But to mitigate the warning I've released a fix that checks if the component is mounted (this.isMounted) before doing this.forceUpdate. Released as 1.0.3 :-)

@eiriklv eiriklv closed this as completed Aug 13, 2015
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

2 participants