My issue involves a Material UI treeView
. After expanding it, an API call is made, but the node in the treeView
remains open. I have attempted to use onNodeToggle
without success.
Below is my code:
<TreeView
className={classes.root1}
defaultExpandIcon={<ArrowDropDownIcon />}
defaultCollapseIcon={<ArrowDropUpIcon />}
defaultEndIcon={<ArrowDropDownIcon />}
disableSelection={true}
expanded={expanded}
collapsed={expanded}
>
{renderTree(row, index)}
</TreeView>
Is there a way to collapse it? Can this be fixed? Is it possible to collapse nodes in a Material UI treeView?