UNPKG

@rlyle1179/react-treeview

Version:

A modern, themable and configurable treeview for React.

51 lines (44 loc) 744 B
import React from 'react'; import TreeView from '../../../../src/deni-react-treeview/deni-react-treeview'; class Example extends React.Component{ render() { return ( <TreeView items={ fruitsAndVegetables } /> ); } } export default Example; let fruitsAndVegetables = [ { id: 100, text: 'Fruits', children: [ { id: 101, text: 'Orange', isLeaf: true }, { id: 102, text: 'Banana', isLeaf: true } ] }, { id: 200, text: 'Vegetables', children: [ { id: 201, text: 'Carrot', isLeaf: true }, { id: 202, text: 'Tomato', isLeaf: true } ] } ];