1.0.4 • Published 2 years ago

react-bookmark-tree v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

A simple react folder tree component

Install

npm i react-bookmark-tree

Usage

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"
  },
]