Created
August 16, 2017 08:35
-
-
Save AkshayRana92/f2d0e04a9d3e10d1b8edcb6214f2c4a5 to your computer and use it in GitHub Desktop.
This file contains 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
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