A simple react folder tree component
npm i react-bookmark-tree
import { Tree } from "react-boomark-tree"
...
<Tree folderList={folderList} />
...
Tree.propTypes = {
folderList: PropTypes.array.isRequired
};.
Injection of plain array consist of objects is required for usage. The listed component turns the prop structure into a nested array with hierarchical structures. folderlist json example is as below:
export const folderList = [
{
"_id": "a",
"title": "초보자용 리액트 링크모음",
"parent_folder": "root"
},
{
"_id": "b",
"title": "중급자용 리액트 링크모음",
"parent_folder": "root"
},
{
"_id": "c",
"title": "고급자용 리액트 링크모음",
"parent_folder": "a"
},
{
"_id": "d",
"title": "초보자용 노드 링크모음",
"parent_folder": "a"
},
]