Given a data object resembling a folder structure, create a folder structure UI resembling that of VS code with appropriate functionalities.
You're given a data.js
file containing an object representing a folder structure. Every object inside of the global object has a key called isFolder
isFolder
will let you know if the current object contains children or not. If true
- object will have children.
<Folder />
component takes in a prop called files
- which is the data object that we talked about earlier.index.js
file will show a JavaScipt icon.Click to reveal
Recursion is your best friend. :)
Click to reveal
isFolder
boolean will help you determine if you want to recurse any further or not.