Do not use deprecated `isMounted`
parent
9eb8f0b6ac
commit
2feae02477
|
@ -33,8 +33,7 @@ export default class Picker extends React.Component {
|
|||
|
||||
componentDidMount() {
|
||||
if (this.state.firstRender) {
|
||||
setTimeout(() => {
|
||||
if (!this.isMounted) return
|
||||
this.firstRenderTimeout = setTimeout(() => {
|
||||
this.setState({ firstRender: false })
|
||||
}, 60)
|
||||
}
|
||||
|
@ -45,6 +44,11 @@ export default class Picker extends React.Component {
|
|||
this.handleScroll()
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
clearTimeout(this.leaveTimeout)
|
||||
clearTimeout(this.firstRenderTimeout)
|
||||
}
|
||||
|
||||
testStickyPosition() {
|
||||
var stickyTestElement = document.createElement('div')
|
||||
for (let prefix of ['', '-webkit-', '-ms-', '-moz-', '-o-']) {
|
||||
|
|
Loading…
Reference in New Issue