Skip to content

Commit

Permalink
fix: Uninstall the listener on componentWillUnmount to ensure the ele…
Browse files Browse the repository at this point in the history
…ment-resize-detector is correctly set up on next mount. (#13)

Fixes #12
  • Loading branch information
ValentinH authored and okonet committed Mar 7, 2017
1 parent 5cda8f1 commit df973d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class ContainerDimensions extends Component {
}

componentWillUnmount() {
this.elementResizeDetector.removeListener(this.parentNode, this.onResize)
this.elementResizeDetector.uninstall(this.parentNode)
}

onResize() {
Expand Down

0 comments on commit df973d8

Please sign in to comment.