-
Notifications
You must be signed in to change notification settings - Fork 26
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
The handler onResize
was still triggered after a component has been unmount
#7
Comments
Well, that's a warning, not an error, to begin with. I'm not sure how to solve this but I'm also not sure if this should be solved. Nothing bad is happening in this case. I could try set some flag that event listener is set and remove it on onUnmount. Do you want to submit a PR? |
@okonet Something don't show because this warning! That's why I notice this warning. I think some events are still triggered although the listener has been removed. componentWillUnmount() {
this.elementResizeDetector.removeListener(this.parentNode, this.onResize)
} So I try to uninstall the resize detector, but some other error happens: I'm not familiar with the element-resize-detector. It'll take me some time to find the solution. So I ask you for help! |
Can you create a repo with this error easily reproducible? |
https://github.com/xile611/react-container-dimensions-demo And you are right! The warning doesn't affect the running of my component. It's another problem! But I want to fix this warning because I'm worried about whether this will result in performance problems. |
👌 Submit a PR and don't forget tests! |
wish fix as soon as.....Recharts use this package and get some effect . |
@tomsue Can you submit a PR. Please also add tests for it. Thanks! |
@tomsue It's a good idea to add the variable |
@okonet
I find that when a ContainerDimensions element has been mount and unmount quickly an error is thrown.
This error happens because the ready event of scroll is trigger although the listener has been removed.
Do you have any idea to fix this problem ? Thank you !
The text was updated successfully, but these errors were encountered: