mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-29 16:30:54 +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() {
|
componentDidMount() {
|
||||||
this.measure();
|
this.measure();
|
||||||
|
window.addEventListener('resize', this.measure);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps: typeof MeasureHeight.prototype.props) {
|
componentDidUpdate(prevProps: typeof MeasureHeight.prototype.props) {
|
||||||
@ -45,6 +46,10 @@ export default class MeasureHeight extends PureComponent<{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
window.removeEventListener('resize', this.measure);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const props: Object = omit(this.props, [
|
const props: Object = omit(this.props, [
|
||||||
'shouldMeasure',
|
'shouldMeasure',
|
||||||
|
Loading…
Reference in New Issue
Block a user