You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
When I tried to follow the instructors in the readme file to create custom decorators, I am getting this error. Can someone tell me the right approach as the one mentioned in the readme seems wrong!
When I tried to follow the instructors in the readme file to create custom decorators, I am getting this error. Can someone tell me the right approach as the one mentioned in the readme seems wrong!
Here is the code:
const decorators = { Header: (props) => { return ( <div style={props.style}> {props.node.name} </div> ); } }; class TreeExample extends React.Component { constructor(props){ super(props); this.state = {}; this.onToggle = this.onToggle.bind(this); } onToggle(node, toggled){ if(this.state.cursor){this.state.cursor.active = false;} node.active = true; if(node.children){ node.toggled = toggled; } this.setState({ cursor: node }); } render(){ return ( <Treebeard data={data} onToggle={this.onToggle} decorators={decorators} /> ); } }
No issue with the data, my data is a big json so, not sharing here.
The text was updated successfully, but these errors were encountered: