We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Couldn't load subscription status. Retry
There was an error while loading. Please reload this page.
1 parent 48687c5 commit e81182aCopy full SHA for e81182a
README.md
@@ -17,16 +17,18 @@ import React, { Component } from 'react';
17
import SortableTree from 'react-sortable-tree';
18
19
export default class Tree extends Component {
20
- constructor() {
+ constructor(props) {
21
+ super(props);
22
+
23
this.state = {
- treeData: { title: 'Chicken', children: [ { title: 'Egg' } ] },
24
+ treeData: [{ title: 'Chicken', children: [ { title: 'Egg' } ] }],
25
};
26
}
27
28
render() {
29
return (
30
<SortableTree
- treeData={treeData}
31
+ treeData={this.state.treeData}
32
onChange={treeData => this.setState({ treeData })}
33
/>
34
);
0 commit comments