diff --git a/src/components/MeasureHeight.js b/src/components/MeasureHeight.js index c8208d9..e685064 100644 --- a/src/components/MeasureHeight.js +++ b/src/components/MeasureHeight.js @@ -37,6 +37,7 @@ export default class MeasureHeight extends PureComponent<{ componentDidMount() { this.measure(); + window.addEventListener('resize', this.measure); } componentDidUpdate(prevProps: typeof MeasureHeight.prototype.props) { @@ -45,6 +46,10 @@ export default class MeasureHeight extends PureComponent<{ } } + componentWillUnmount() { + window.removeEventListener('resize', this.measure); + } + render() { const props: Object = omit(this.props, [ 'shouldMeasure',