mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-28 20:43:56 +03:00
[react-json-tree] Mark deprecated React lifecycle methods as unsafe (#483)
This commit is contained in:
parent
5ef08d04f1
commit
fa90ae0a59
|
@ -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);
|
||||
|
|
2
packages/react-json-tree/src/index.js
vendored
2
packages/react-json-tree/src/index.js
vendored
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user