Last active
April 28, 2018 21:10
-
-
Save MorenoMdz/b231ecd6443665660b158b3adbcca3e1 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
/* Controlled Component With Update */ | |
<input | |
type='text' | |
name='inputText' | |
value={this.state.inputText} | |
onChange={(e) => { | |
this.setState({inputText: e.target.value}) | |
}} | |
/> | |
/** | |
* On every change event (e) (letter type etc) it will call this.state.inputText | |
* with the value from e.target.value | |
* That will call render and update the value in the component. | |
* The next time something is input setState will call the render and run it again | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment