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

"You called setState() on an unmounted component." #183

Closed
drewvolz opened this issue Aug 29, 2016 · 7 comments
Closed

"You called setState() on an unmounted component." #183

drewvolz opened this issue Aug 29, 2016 · 7 comments

Comments

@drewvolz
Copy link
Member

drewvolz commented Aug 29, 2016

Loading a module of the app and then pressing back before the data loads causes this warning.

screen shot 2016-08-23 at 8 34 41 am

@drewvolz drewvolz changed the title SetState on unmourned components SetState on unmounted components Aug 29, 2016
@hawkrives
Copy link
Member

Whee.

I'm honestly not sure how to deal with this. Just putting an isMounted check would still be subject to race conditions, and you can't cancel a promise.

I'll do some research today.

@hawkrives
Copy link
Member

btw this is why an isMounted check isn't enough: https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html

@hawkrives
Copy link
Member

this is probably what I'll end up using – bluebird's promise cancellation and some code to cancel promises in componentWillUnmounthttp://bluebirdjs.com/docs/api/cancellation.html

I'll take a stab at this after the SIS Oauth stuff

@hawkrives hawkrives changed the title SetState on unmounted components setState on unmounted components Nov 10, 2016
@hawkrives hawkrives changed the title setState on unmounted components "You called setState() on an unmounted component." May 18, 2017
@hawkrives
Copy link
Member

@hawkrives
Copy link
Member

I'd like to close this – it's not really actionable, as stands, and I think that as we slowly refactor things to take advantage of hooks we will cause this less often.

@drewvolz
Copy link
Member Author

I still see this issue, and I think we could solve it.

@drewvolz
Copy link
Member Author

But alright. Closing.

drewvolz pushed a commit that referenced this issue Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants