Added new method to PullToRefresher on init/deinit

• Added:
- new method to PullToRefresher on init/deinit
This commit is contained in:
mgabdev 2020-11-05 12:00:38 -06:00
parent 9c4db8eaf3
commit 472c89d386

@ -18,6 +18,8 @@ class PullToRefresher extends React.PureComponent {
}
componentDidMount() {
this.handleDestroy()
if (this.props.isDisabled) return
if (this.state.width > BREAKPOINT_EXTRA_SMALL) return
@ -48,6 +50,10 @@ class PullToRefresher extends React.PureComponent {
}
componentWillUnmount() {
this.handleDestroy()
}
handleDestroy() {
PullToRefresh.destroyAll()
window.removeEventListener('resize', this.handleResize, false)
}