Move code out of deprecated componentWillUpdate()

> 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.
This commit is contained in:
Justin Stephenson 2020-04-27 16:35:08 -04:00
parent 6a7f6805d9
commit 395cbdc2c9

View file

@ -1174,14 +1174,6 @@ export class Player extends React.Component {
this.initSlider(); 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) { componentDidUpdate(prevProps, prevState) {
/* If we changed pause state or speed exponent */ /* If we changed pause state or speed exponent */
if (this.state.paused != prevState.paused || if (this.state.paused != prevState.paused ||