/react-treeview-recursive

Example of recursive tree view in ReactJS

Primary LanguageJavaScriptMIT LicenseMIT

React TreeView Recursive Example

Can be the React component recursive? Why not, after all it's JavaScript function. This repo contains a sample of Recursive TreeView Component.

There is well known example of Tree View made by chenglou. It works quite good, but only if you know the level of your tree in advance.

This example on the other hand can handle the data more dynamically. Check the demo with two examples.

If you want to test it, simply clone the repo.

Updated to React 16.x with great inspiration and help from Create React App tool.

Run:

npm install
npm start

Check your http://localhost:3000/ and then put your data to the scripts/mockData.js.