Created
February 29, 2016 22:56
-
-
Save coopy/169fc59bcad9f86ac369 to your computer and use it in GitHub Desktop.
Managed React input
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
const Form = React.createClass({ | |
// keeps state and re-renders <Input/> when `handleChange` is called back. | |
}); | |
const Input = ({ inputValue, handleChange }) => { | |
return ( | |
<input value={inputValue} onChange={(ev) => {handleChange(ev.target.value)}} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment