Tree not re rendering after button click and updating data?
Closed this issue · 3 comments
0xrushi commented
Tree not re rendering after button click and updating data?
0xrushi commented
onMck = () => {
this.setState({data :[{
"id": 87654325,
"label": "My file9",
"parentId": 56789012
}]});
console.log(this.state.data);
// document.getElementById("mtree").innerHTML = createTree(data)
};
<button onClick={this.onMck}/>
<Tree nodes={this.state.data} onSelect={this.onSelect} theme={'my-theme'} customTheme={myTheme}/>
ortonomy commented
is this.state.data
empty before your button press?
ortonomy commented
this should be fixed now in v2. Let me know if it's still a problem