From fa90ae0a597b1d7ee9018b20bd23538e82fa97c7 Mon Sep 17 00:00:00 2001 From: Joe Huang Date: Mon, 4 May 2020 08:19:01 -0700 Subject: [PATCH] [react-json-tree] Mark deprecated React lifecycle methods as unsafe (#483) --- packages/react-json-tree/src/JSONNestedNode.js | 2 +- packages/react-json-tree/src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-json-tree/src/JSONNestedNode.js b/packages/react-json-tree/src/JSONNestedNode.js index e19aa253..2c3afcac 100644 --- a/packages/react-json-tree/src/JSONNestedNode.js +++ b/packages/react-json-tree/src/JSONNestedNode.js @@ -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); diff --git a/packages/react-json-tree/src/index.js b/packages/react-json-tree/src/index.js index 0fe936bd..e7504eb7 100644 --- a/packages/react-json-tree/src/index.js +++ b/packages/react-json-tree/src/index.js @@ -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)); }