diff --git a/packages/react-json-tree/src/JSONNestedNode.tsx b/packages/react-json-tree/src/JSONNestedNode.tsx index c38dddd3..2f03c282 100644 --- a/packages/react-json-tree/src/JSONNestedNode.tsx +++ b/packages/react-json-tree/src/JSONNestedNode.tsx @@ -176,7 +176,8 @@ export default function JSONNestedNode(props: Props) { data, itemType, createItemString(data, collectionLimit), - keyPath + keyPath, + expandedRef.current, ); const stylingArgs = [ keyPath, diff --git a/packages/react-json-tree/src/types.ts b/packages/react-json-tree/src/types.ts index 6a67f376..357979ec 100644 --- a/packages/react-json-tree/src/types.ts +++ b/packages/react-json-tree/src/types.ts @@ -10,7 +10,8 @@ export type GetItemString = ( data: unknown, itemType: React.ReactNode, itemString: string, - keyPath: KeyPath + keyPath: KeyPath, + isExpanded: boolean, ) => React.ReactNode; export type LabelRenderer = (