Hi
It would be nice to be able to 'hide' the root element.
So for example, for this object:
[
{
"foo": "bar",
"lorem": 1
},
{
"hi": "hello",
"lorem": 2
},
{
"etc": "etera",
"lorem": 3
}
]
Display just:
or:

I achieved similar behavior using:
if (Array.isArray(value)) {
root.render(
<div className="flex flex-col gap-2">
{value.map((item, i) => (
<JsonView
key={i}
value={item}
collapsed={3}
enableClipboard={false}
displayDataTypes={false}
/>
))}
</div>
);
} else {
root.render(
<JsonView
value={value}
collapsed={3}
enableClipboard={false}
displayDataTypes={false}
/>
);
}
but it would be nice to have a built-in feature to reduce code duplication and overhead.
(I guess there's no reason to limit it to just arrays, but that was my particular use case)
Hi
It would be nice to be able to 'hide' the root element.
So for example, for this object:
[ { "foo": "bar", "lorem": 1 }, { "hi": "hello", "lorem": 2 }, { "etc": "etera", "lorem": 3 } ]Display just:
or:

I achieved similar behavior using:
but it would be nice to have a built-in feature to reduce code duplication and overhead.
(I guess there's no reason to limit it to just arrays, but that was my particular use case)