Skip to content

Commit

Permalink
[react-json-tree] Mark deprecated React lifecycle methods as unsafe (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dehorser authored May 4, 2020
1 parent 5ef08d0 commit fa90ae0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-json-tree/src/JSONNestedNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class JSONNestedNode extends React.Component {
this.state = getStateFromProps(props);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const nextState = getStateFromProps(nextProps);
if (getStateFromProps(this.props).expanded !== nextState.expanded) {
this.setState(nextState);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-json-tree/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default class JSONTree extends React.Component {
this.state = getStateFromProps(props);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (['theme', 'invertTheme'].find(k => nextProps[k] !== this.props[k])) {
this.setState(getStateFromProps(nextProps));
}
Expand Down

0 comments on commit fa90ae0

Please sign in to comment.