Skip to content

Instantly share code, notes, and snippets.

@sfrdmn
Created December 1, 2017 15: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 sfrdmn/67faeb23222bd04fce7c4abbbc592d2f to your computer and use it in GitHub Desktop.
Save sfrdmn/67faeb23222bd04fce7c4abbbc592d2f to your computer and use it in GitHub Desktop.
mcr_post_03
const App = ({ foodItems, addFoodItem }) => (
<div>
<ul>
{
foodItems.map(({ name, quantity }) => (
<li>{name}, quantity: {quantity}</li>
))
}
</ul>
<button onClick={() => addFoodItem({ name: '🍋', quantity: 50 })}>
Add Food Item
</button>
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment