Skip to content

Instantly share code, notes, and snippets.

@coopy
Created February 29, 2016 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coopy/169fc59bcad9f86ac369 to your computer and use it in GitHub Desktop.
Save coopy/169fc59bcad9f86ac369 to your computer and use it in GitHub Desktop.
Managed React input
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