mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 14:09:46 +03:00
bugfix on corner case
This commit is contained in:
parent
1f6d0291ee
commit
e664cba9fb
|
@ -111,8 +111,9 @@ export default function JSONNestedNode(props: Props) {
|
||||||
nodeTypeIndicator,
|
nodeTypeIndicator,
|
||||||
shouldExpandNodeInitially,
|
shouldExpandNodeInitially,
|
||||||
shouldExpandNode,
|
shouldExpandNode,
|
||||||
styling,
|
setShouldExpandNode,
|
||||||
setEnableDefaultButton,
|
setEnableDefaultButton,
|
||||||
|
styling,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const [expanded, setExpanded] = useState<boolean>(
|
const [expanded, setExpanded] = useState<boolean>(
|
||||||
|
@ -135,8 +136,9 @@ export default function JSONNestedNode(props: Props) {
|
||||||
if (expandable) {
|
if (expandable) {
|
||||||
setExpanded(!expanded);
|
setExpanded(!expanded);
|
||||||
setEnableDefaultButton(true);
|
setEnableDefaultButton(true);
|
||||||
|
setShouldExpandNode(undefined)
|
||||||
}
|
}
|
||||||
}, [expandable, expanded, setEnableDefaultButton]);
|
}, [expandable, expanded, setEnableDefaultButton, setShouldExpandNode]);
|
||||||
|
|
||||||
const renderedChildren =
|
const renderedChildren =
|
||||||
expanded || (hideRoot && level === 0)
|
expanded || (hideRoot && level === 0)
|
||||||
|
|
|
@ -79,6 +79,7 @@ export function JSONTree({
|
||||||
shouldExpandNodeInitially={shouldExpandNodeInitially}
|
shouldExpandNodeInitially={shouldExpandNodeInitially}
|
||||||
shouldExpandNode={shouldExpandNode}
|
shouldExpandNode={shouldExpandNode}
|
||||||
setEnableDefaultButton={setEnableDefaultButton}
|
setEnableDefaultButton={setEnableDefaultButton}
|
||||||
|
setShouldExpandNode={setShouldExpandNode}
|
||||||
hideRoot={hideRoot}
|
hideRoot={hideRoot}
|
||||||
getItemString={getItemString}
|
getItemString={getItemString}
|
||||||
postprocessValue={postprocessValue}
|
postprocessValue={postprocessValue}
|
||||||
|
|
|
@ -54,6 +54,7 @@ export interface CommonExternalProps {
|
||||||
collectionLimit: number;
|
collectionLimit: number;
|
||||||
sortObjectKeys: SortObjectKeys;
|
sortObjectKeys: SortObjectKeys;
|
||||||
setEnableDefaultButton: any;
|
setEnableDefaultButton: any;
|
||||||
|
setShouldExpandNode: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CommonInternalProps extends CommonExternalProps {
|
export interface CommonInternalProps extends CommonExternalProps {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user