mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Mark deprecated React lifecycle methods as unsafe
This will allow this package to be updated to React 17. For more information, see: https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
This commit is contained in:
parent
03d1448dc3
commit
567fff5018
|
@ -109,7 +109,7 @@ export default class JSONNestedNode extends React.Component {
|
||||||
this.state = getStateFromProps(props);
|
this.state = getStateFromProps(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||||
const nextState = getStateFromProps(nextProps);
|
const nextState = getStateFromProps(nextProps);
|
||||||
if (getStateFromProps(this.props).expanded !== nextState.expanded) {
|
if (getStateFromProps(this.props).expanded !== nextState.expanded) {
|
||||||
this.setState(nextState);
|
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);
|
this.state = getStateFromProps(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||||
if (['theme', 'invertTheme'].find(k => nextProps[k] !== this.props[k])) {
|
if (['theme', 'invertTheme'].find(k => nextProps[k] !== this.props[k])) {
|
||||||
this.setState(getStateFromProps(nextProps));
|
this.setState(getStateFromProps(nextProps));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user