Skip to content

Instantly share code, notes, and snippets.

@AkshayRana92
Created August 16, 2017 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkshayRana92/f2d0e04a9d3e10d1b8edcb6214f2c4a5 to your computer and use it in GitHub Desktop.
Save AkshayRana92/f2d0e04a9d3e10d1b8edcb6214f2c4a5 to your computer and use it in GitHub Desktop.
class App extends Component {
constructor() {
super()
this.state = {name: 'Say my name'}
}
handleName(newName) {
this.setState({ name: newName});
}
render() {
return (
<div className="App">
<Child name={this.state.name} onNameChange={this.handleName.bind(this)}/>
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment