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
setState() on unmounted component, possible bug or misunderstanding? #180
Comments
Full stack trace of error (though I doubt it helps because webpack):
|
Hello @linkenneth, I don't know exactly what happen in your case. But you pointed out a problem in the current implementation. The |
Thanks. I thought something was strange as well, but it doesn't look like my case is related. I also left a comment on your commit. |
Hi! Thanks again for the great library.
I upgraded from
loadable-components@2.2.3
to@loadable/component@5.2.1
in order to use the now-supported refs of #108, but after some tweaking I'm still stuck with the following error:The complaint seems to be that
loadAsync()
, triggered fromcomponentDidMount()
https://github.com/smooth-code/loadable-components/blob/4e99a97c5ae958c4f18ac82b7e1a3566bc81c912/packages/component/src/createLoadable.js#L63 seems to be somehow callingthis.setState
https://github.com/smooth-code/loadable-components/blob/4e99a97c5ae958c4f18ac82b7e1a3566bc81c912/packages/component/src/createLoadable.js#L96 despite not being mounted. That is, theInnerLoadable
component itself is not yet mounted, despite being called fromcomponentDidMount
. Is this ever possible?It's a bit hard to share the entirety of my own code, as it's our entry point that triggers the error. For what it's worth, this is the component causing the problem:
If it helps as well, there may also be a few other loadables loaded once
LessonView
loads. Could that be the cause of the issue?The text was updated successfully, but these errors were encountered: