Closed karleberts closed 8 years ago
Upstream: https://github.com/KyleAMathews/element-resize-event/pull/11 An alternative would be to use https://github.com/wnr/element-resize-detector but it is a large library.
Released 2.0.7 w/ @karleberts' fix.
Normally, when the component is unmounted, window.removeEventListener is called for the resize handler. If, however, you are using the 'elementResize' config option, the handler can end up being called after the component is unmounted.
Perhaps adding a check in the getWidth function to see if the element still exists could make this safer?