Created
January 13, 2020 16:02
-
-
Save JakenHerman/c039a98ce3db2ceacfac260883da8df8 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 React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
titleName: '' | |
}; | |
} | |
changeTitle(ev) { | |
this.setState({ | |
titleName: ev.target.value | |
}); | |
} | |
render() { | |
return (<div className="App"><h1>{this.state.titleName}</h1><input onChange={this.changeTitle.bind(this)}></input></div>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment