Skip to content

Instantly share code, notes, and snippets.

@JonAbrams
Last active July 23, 2018 01:03
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 JonAbrams/ad75fe4b7f14064cfce0bc02cb31a8d4 to your computer and use it in GitHub Desktop.
Save JonAbrams/ad75fe4b7f14064cfce0bc02cb31a8d4 to your computer and use it in GitHub Desktop.
export const PizzaForm = ({ space }) => (
<form>
<label>Name</label>
<input
type="text"
value={space.name || ''}
onChange={space('name')} // Whenever user types, `space.name` is updated
/>
<label>Do you like pizza?</label>
<input
type="checkbox"
checked={space.pizzaLover || false}
onChange={space('pizzaLover')} // Assigns true or false to `space.pizzaLover`
/>
</form>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment