Skip to content

Instantly share code, notes, and snippets.

@AkshayRana92
Created Aug 16, 2017
Embed
What would you like to do?
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