mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-25 22:50:04 +05:30
#305: re-measure height on window resize
This commit is contained in:
parent
b9dcbf8647
commit
b032cef120
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user