Added new method to PullToRefresher on init/deinit
• Added: - new method to PullToRefresher on init/deinit
This commit is contained in:
parent
9c4db8eaf3
commit
472c89d386
@ -18,6 +18,8 @@ class PullToRefresher extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
this.handleDestroy()
|
||||||
|
|
||||||
if (this.props.isDisabled) return
|
if (this.props.isDisabled) return
|
||||||
if (this.state.width > BREAKPOINT_EXTRA_SMALL) return
|
if (this.state.width > BREAKPOINT_EXTRA_SMALL) return
|
||||||
|
|
||||||
@ -48,6 +50,10 @@ class PullToRefresher extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
this.handleDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
handleDestroy() {
|
||||||
PullToRefresh.destroyAll()
|
PullToRefresh.destroyAll()
|
||||||
window.removeEventListener('resize', this.handleResize, false)
|
window.removeEventListener('resize', this.handleResize, false)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user