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,
|
||||
shouldExpandNodeInitially,
|
||||
shouldExpandNode,
|
||||
styling,
|
||||
setShouldExpandNode,
|
||||
setEnableDefaultButton,
|
||||
styling,
|
||||
} = props;
|
||||
|
||||
const [expanded, setExpanded] = useState<boolean>(
|
||||
|
@ -135,8 +136,9 @@ export default function JSONNestedNode(props: Props) {
|
|||
if (expandable) {
|
||||
setExpanded(!expanded);
|
||||
setEnableDefaultButton(true);
|
||||
setShouldExpandNode(undefined)
|
||||
}
|
||||
}, [expandable, expanded, setEnableDefaultButton]);
|
||||
}, [expandable, expanded, setEnableDefaultButton, setShouldExpandNode]);
|
||||
|
||||
const renderedChildren =
|
||||
expanded || (hideRoot && level === 0)
|
||||
|
|
|
@ -79,6 +79,7 @@ export function JSONTree({
|
|||
shouldExpandNodeInitially={shouldExpandNodeInitially}
|
||||
shouldExpandNode={shouldExpandNode}
|
||||
setEnableDefaultButton={setEnableDefaultButton}
|
||||
setShouldExpandNode={setShouldExpandNode}
|
||||
hideRoot={hideRoot}
|
||||
getItemString={getItemString}
|
||||
postprocessValue={postprocessValue}
|
||||
|
|
|
@ -54,6 +54,7 @@ export interface CommonExternalProps {
|
|||
collectionLimit: number;
|
||||
sortObjectKeys: SortObjectKeys;
|
||||
setEnableDefaultButton: any;
|
||||
setShouldExpandNode: any;
|
||||
}
|
||||
|
||||
export interface CommonInternalProps extends CommonExternalProps {
|
||||
|
|
Loading…
Reference in New Issue
Block a user