react for dummies..
This commit is contained in:
parent
bd1ee0cfe9
commit
77404d0be6
1 changed files with 4 additions and 3 deletions
|
|
@ -10,11 +10,12 @@ class Tree extends Component {
|
|||
}
|
||||
|
||||
loadData() {
|
||||
console.log(this);
|
||||
axios.get("http://localhost:2048/callstack")
|
||||
.then(response => this.setState({ data: response.data }));
|
||||
}
|
||||
|
||||
clear() {
|
||||
clearData() {
|
||||
axios.get("http://localhost:2048/clear")
|
||||
.then(response => this.setState({ data: response.data }));
|
||||
}
|
||||
|
|
@ -36,8 +37,8 @@ class Tree extends Component {
|
|||
render() {
|
||||
return (
|
||||
<div>
|
||||
<button type="button" onClick={this.clear}>clear</button>
|
||||
<button type="button" onClick={this.loadData}>refresh</button>
|
||||
<button type="button" onClick={() => this.clearData()}>clear</button>
|
||||
<button type="button" onClick={() => this.loadData()}>refresh</button>
|
||||
<div className="view"><h1>Callstack view</h1>
|
||||
<div className="treeView">
|
||||
{this.renderChildren(this.state.data)}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue