Make JSONNestedNode fully controlled

This commit is contained in:
Bruno Fenzl 2020-09-25 10:45:25 +02:00
parent 0ae52223dc
commit d05bd5311b

View File

@ -145,14 +145,6 @@ export default class JSONNestedNode extends React.Component<Props, State> {
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) {
return (
!!Object.keys(nextProps).find(