Skip to content

Commit df973d8

Browse files
ValentinHokonet
authored andcommitted
fix: Uninstall the listener on componentWillUnmount to ensure the element-resize-detector is correctly set up on next mount. (#13)
Fixes #12
1 parent 5cda8f1 commit df973d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class ContainerDimensions extends Component {
3030
}
3131

3232
componentWillUnmount() {
33-
this.elementResizeDetector.removeListener(this.parentNode, this.onResize)
33+
this.elementResizeDetector.uninstall(this.parentNode)
3434
}
3535

3636
onResize() {

0 commit comments

Comments
 (0)