1componentDidMount() {
2 this.setState({
3 thing: [
4 {
5 status: "running",
6 test: "testing"
7 }
8 ]
9 });
10}
11
12render() {
13 return (
14 <div>
15 {this.state.thing.length > 0? <h1 className="mt-5 mb-5">{ this.state.thing[0].status }</h1>: null
16}
17 <button className="mt-5" onClick={ this.handleUpdate } value="not running">
18 Click to change
19 </button>
20 </div>
21 );
22}