Skip to content

Commit

Permalink
Move code out of deprecated componentWillUpdate()
Browse files Browse the repository at this point in the history
> warning: Warning: componentWillUpdate has been renamed, and is not
recommended for use. See https://fb.me/react-unsafe-component-lifecycles
for details.

* Move data fetching code or side effects to componentDidUpdate.
  • Loading branch information
justin-stephenson committed Apr 27, 2020
1 parent 6a7f680 commit 395cbdc
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/player.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1174,14 +1174,6 @@ export class Player extends React.Component {
this.initSlider();
}

componentWillUpdate(nextProps, nextState) {
/* If we changed pause state or speed exponent */
if (nextState.paused != this.state.paused ||
nextState.speedExp != this.state.speedExp) {
this.sync();
}
}

componentDidUpdate(prevProps, prevState) {
/* If we changed pause state or speed exponent */
if (this.state.paused != prevState.paused ||
Expand Down

0 comments on commit 395cbdc

Please sign in to comment.