Open
Description
It doesn't seem like it's possible to get the collapsed state of the current node within getItemString
. Is this true?
The signature seems to be:
<JSONTree
...
getItemString={(type, data, itemType, itemString, keyPath) => <span>{itemType} {itemString}</span>}
/>
But without knowing the collapsed state, it's not possible to do something like this:
which would increase legibility and allow for other use cases, like showing a stringified preview of the child content when collapsed.
Some of the above and more could be helped with classNames that change based on the state of the node.
If there was a theme convention like:
nestedNode: className
nestedNodeCollapsed: className
nestedNodeTypeArray: className
The layout could changed based on the node state. I tried to hack my way through some layout changes, but there's no way to accomplish some of these things without having access to the state.