Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

fix warning at #2680 #2681

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/atom/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/views/git-timings-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down