Skip to content

Commit

Permalink
change deprecated react method
Browse files Browse the repository at this point in the history
componentWillReceiveProps() is now UNSAFE_componentWillReceiveProps() but should probably replaced in the future, see https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
added a TODO comment with that URL as well
  • Loading branch information
Stanzilla committed May 22, 2018
1 parent db1bbf8 commit ec040be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/components/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default class Notification extends React.PureComponent {
}
}

componentWillReceiveProps(next) {
// TODO https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
UNSAFE_componentWillReceiveProps(next) {
// if we have a timer going and the notification text
// changed we reset the timer
if (next.text !== this.props.text) {
Expand Down
3 changes: 2 additions & 1 deletion lib/components/term-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class TermGroup_ extends React.PureComponent {
return <Term ref_={this.onTermRef} key={uid} {...props} />;
}

componentWillReceiveProps(nextProps) {
// TODO https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.termGroup.sizes != nextProps.termGroup.sizes || nextProps.sizeChanged) {
this.term && this.term.fitResize();
// Indicate to children that their size has changed even if their ratio hasn't
Expand Down
3 changes: 2 additions & 1 deletion lib/components/term.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ export default class Term extends React.PureComponent {
return !e.catched;
}

componentWillReceiveProps(nextProps) {
// TODO https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
UNSAFE_componentWillReceiveProps(nextProps) {
if (!this.props.cleared && nextProps.cleared) {
this.clear();
}
Expand Down
3 changes: 2 additions & 1 deletion lib/containers/hyper.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class Hyper extends React.PureComponent {
};
}

componentWillReceiveProps(next) {
// TODO https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
UNSAFE_componentWillReceiveProps(next) {
if (this.props.backgroundColor !== next.backgroundColor) {
// this can be removed when `setBackgroundColor` in electron
// starts working again
Expand Down

0 comments on commit ec040be

Please sign in to comment.