I am fetching a JSON file and want to make a visual tree representation of it.
The file itself is quite large, therefore what I want is using a loop to only display the very first keys that are found in an object (in that iteration). A key that has child nodes is displayed with an arrow next to it.
I have a TreeItem component:
<TreeView>
<TreeItem nodeId="1" label="First Key" />
<TreeItem nodeId="2" label="Second Key">
<TreeItem nodeId="3" label="First Child" />
<TreeItem nodeId="4" label="Second Child" />
<TreeItem nodeId="5" label="Third Child" />
</TreeItem>
<TreeView>
Is there a way I can embed the child TreeItem components if I know that the second key has children?