Skip to content

Latest commit

Β 

History

History
63 lines (32 loc) Β· 1.19 KB

File metadata and controls

63 lines (32 loc) Β· 1.19 KB

πŸ“ React Folder Explorer

A simple React application to simulate a file/folder explorer with nested folder structure. Users can dynamically add folders and files into any folder level.


πŸš€ Features

  • Expand/Collapse folder structure

  • Add new folders and files dynamically

  • Visual distinction between folders πŸ“‚ and files πŸ“„

  • Recursive rendering of nested items


πŸ“¦ Folder Structure

β”œβ”€β”€ public/

β”œβ”€β”€ src/

β”‚ β”œβ”€β”€ components/

β”‚ β”‚ └── Folder.jsx # Recursive folder component

β”‚ β”œβ”€β”€ data/

β”‚ β”‚ └── folderData.js # Initial data structure

β”‚ β”œβ”€β”€ hook/

β”‚ β”‚ └── use-traverse-file.js # Logic to insert files/folders

β”‚ β”œβ”€β”€ App.css

β”‚ β”œβ”€β”€ App.jsx

β”‚ └── index.js


🧠 How It Works

πŸ”Ή The folder structure is stored in a nested object (explorer).

πŸ”Ή Folder component recursively renders its child folders/files.

πŸ”Ή use-traverse-file custom hook handles adding new files/folders by modifying the tree structure.


✨ Future Improvements

😎 Add delete and rename functionality

😎 Save data using localStorage or a backend

😎 Drag and drop to move items

😎 Search functionality