diff --git a/lib/atom/commands.js b/lib/atom/commands.js index fdf8544dd0..e4f54634e0 100644 --- a/lib/atom/commands.js +++ b/lib/atom/commands.js @@ -53,9 +53,9 @@ export class Command extends React.Component { this.observeTarget(this.props); } - componentWillReceiveProps(newProps) { - if (['registry', 'target', 'command', 'callback'].some(p => newProps[p] !== this.props[p])) { - this.observeTarget(newProps); + componentDidUpdate(prevProps) { + if (['registry', 'target', 'command', 'callback'].some(p => prevProps[p] !== this.props[p])) { + this.observeTarget(this.props); } } diff --git a/lib/views/git-timings-view.js b/lib/views/git-timings-view.js index f689917673..ef1228bc73 100644 --- a/lib/views/git-timings-view.js +++ b/lib/views/git-timings-view.js @@ -171,8 +171,8 @@ class Waterfall extends React.Component { this.state = this.getNextState(props); } - componentWillReceiveProps(nextProps) { - this.setState(this.getNextState(nextProps)); + componentDidUpdate(_prevProps) { + this.setState(this.getNextState(this.props)); } getNextState(props) {