Created
August 5, 2018 15:21
-
-
Save manoelneto/c06df6bf6f482598f6704033265c1911 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Progress from 'components/Progress'; | |
import ProgressInput from 'components/ProgressInput'; | |
class App extends Component { | |
state = { | |
count: 10 | |
} | |
onChangeCount = count => { | |
this.setState({count}); | |
} | |
render() { | |
return <div> | |
<div> | |
O progresso é {this.state.count} | |
</div> | |
<Progress value={this.state.count} /> | |
<ProgressInput value={this.state.count} onChange={this.onChangeCount}/> | |
<div> | |
<button onClick={(evt) => this.onChangeCount(this.state.count + 1) }>Increment</button> | |
<button onClick={(evt) => this.onChangeCount(this.state.count - 1) }>Decrement</button> | |
</div> | |
</div> | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment