I have a flat array of objects which is quite complex and there are no ids in the objects. I have to convert this flat array into nested JSON data by splitting the second element's value and each value will be children of the previous children.array of objects The third/last level which is 2301,2302 etc will have the asset value as its child. nested json hierarchyAny idea how to achieve this? I am fairly new to React. My ultimate goal is to create a sidebar like thistreeview to my React component. Please help!