Skip to content

Instantly share code, notes, and snippets.

@manoelneto
Created August 5, 2018 15:21
Show Gist options
  • Save manoelneto/c06df6bf6f482598f6704033265c1911 to your computer and use it in GitHub Desktop.
Save manoelneto/c06df6bf6f482598f6704033265c1911 to your computer and use it in GitHub Desktop.
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