mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-23 06:29:51 +03:00
Make JSONNestedNode fully controlled
This commit is contained in:
parent
0ae52223dc
commit
d05bd5311b
|
@ -145,14 +145,6 @@ export default class JSONNestedNode extends React.Component<Props, State> {
|
||||||
this.state = getStateFromProps(props);
|
this.state = getStateFromProps(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getDerivedStateFromProps(nextProps: Props, state: State): State | null {
|
|
||||||
const nextState = getStateFromProps(nextProps);
|
|
||||||
if (nextState.expanded !== state.expanded) {
|
|
||||||
return nextState;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps: Props, nextState: State) {
|
shouldComponentUpdate(nextProps: Props, nextState: State) {
|
||||||
return (
|
return (
|
||||||
!!Object.keys(nextProps).find(
|
!!Object.keys(nextProps).find(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user