Skip to content

Instantly share code, notes, and snippets.

@coopy
Created February 29, 2016 22:56
Show Gist options
  • 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