Skip to content

Commit

Permalink
Remove deprecated componentWillReceive props.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Mar 5, 2020
1 parent f83f9e1 commit 641df2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Dots.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class Dots extends Component {
}
}

componentWillReceiveProps ({index}) {
componentDidUpdate ({index}) {
if (index !== this.props.index) {
this.setState({previousIndex: this.props.index})
this.setState({previousIndex: index})
this.timeout = setTimeout(() => {
this.timeout = null
this.setState({previousIndex: index})
}, 450)
this.setState({previousIndex: this.props.index})
}, 400)
}
}

Expand Down

0 comments on commit 641df2d

Please sign in to comment.