forked from cypress-io/cypress-react-unit-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
35 lines (30 loc) · 830 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { Component } from 'react'
import './App.css'
import logo from './logo.svg'
import LoadingIndicator from './LoadingIndicator'
class App extends Component {
state = {
isLoading: true,
}
componentDidMount() {
this._timer = setTimeout(() => this.setState({ isLoading: false }), 2000)
}
componentWillUnmount() {
clearTimeout(this._timer)
}
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<pre>isLoading: {String(this.state.isLoading)}</pre>
<LoadingIndicator isLoading={this.state.isLoading}>
<div>ahoy!</div>
</LoadingIndicator>
</div>
)
}
}
export default App