Package Exports
- react-treebeard
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-treebeard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-treebeard
Fast, Efficient and Customisable Tree View React Component
Install
npm install react-treebeard --saveExample
'use strict';
import React from 'react';
import ReactDOM from 'react-dom';
import Treebeard from 'react-treebeard';
const data = {
id: 0,
name: 'root',
toggled: true,
children: [
{
id: 1,
name: 'parent',
children: [
{
id: 2,
name: 'child',
terminal: true
}
]
},
{
id: 3,
name: 'loading parent',
loading: true
},
{
id: 4,
name: 'parent',
children: [
{
id: 5,
name: 'nested parent',
children: [
{
id: 6,
name: 'nested child',
terminal: true
}
]
}
]
}
]
};
class TreeExample extends React.Component {
constructor(props){
super(props);
}
onToggle(/* node, toggled */){
// ...
}
render(){
return (
<Treebeard
data={data}
onToggle={this.onToggle}
/>
);
}
}
const content = document.getElementById('content');
ReactDOM.render(<TreeExample/>, content);