Hi,
I am trying to make something like this. I already made this but it’s not efficient.

I am thinking of using nested Tree-like Object to display the UI, I can iterate through it by using a recursive call of the same component.
but I cannot wrap my head around with how I would update specific items from the object.
[{
"title": "Food",
"path": "/root",
"children": [{
"title": "Veg",
"path": "/root/Food",
"children": [{
"title": "Carrot",
"path": "/root/Food/Veg",
"children": [{
"title": "Ooty carrot",
"path": "/root/Food/Veg/Brinjal",
"children": []
}]
}]
}]
}, {
"title": "Cloths",
"path": "/root",
"children": [{
"title": "T shirt",
"path": "/root/Cloths",
"children": []
}, {
"title": "Shirt",
"path": "/root/Cloths",
"children": []
}]
}]