-
Notifications
You must be signed in to change notification settings - Fork 91
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
2.0 triggers resize when component unmount #27
Comments
Can you provide a code snippet so I can reproduce this issue? |
I think I'm wrong. |
I'm seeing this issue as well. Simply put, the resize method fires when the component unmounts, which causes the classic React error:
|
@cephirothdy2j hi, please tell me a example code, maybe can I help you ^^ |
I ran into the same issue and could resolve by calling unobserve in componentWillUnmount. Before I did this, I almost did something similar to what the folks behind recharts did https://github.com/recharts/recharts/blob/master/src/component/ResponsiveContainer.js#L71 Notice they are setting a mounted flag to fix this issue. |
Setting the "mounted" flag is what I ended up doing as well. |
#32 @cephirothdy2j can you build and test in your project to see if this works? |
Yes, that PR appears to resolve the issue. 👍 |
Thanks for checking it out. |
Thanks to everyone for your involvement! @matsilva Huge thanks for the PR! :) |
[email protected] published to npm with this fix! |
Awesome! Thanks a lot. |
2.0 triggers resize when component unmount
So the resize remain, if you modify props in -onResize, things will break!
The text was updated successfully, but these errors were encountered: