Async content
Data initializing
import React from 'react'
import EyzyTree from 'eyzy-tree'
import AwesomeLoadingIndicator from 'awesome-loading-indicator'
import 'eyzy-tree/style.css'
export default LazyTree extends React.Component {
// https://babeljs.io/docs/en/babel-plugin-proposal-class-properties
// instead you can use constructor :)
state = {
treeData: [],
isDataLoaded: false
}
componentDidMount() {
fetch('/awesome_API/v1/?tree')
.then(response => response.json())
.then(data => {
this.setState({
isDataLoaded: true,
treeData: data
})
})
}
render() {
if (!this.state.isDataLoaded) {
return <AwesomeLoadingIndicator />
}
return (
<EyzyTree data={this.state.treeData} />
)
}
}Node's property
Using API
Insertion options
Last updated