Skip to content

Instantly share code, notes, and snippets.

@timbuckley
Last active September 24, 2020 00:39
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 timbuckley/2d6e2bb66696a0345fcc9e3d6185ea49 to your computer and use it in GitHub Desktop.
Save timbuckley/2d6e2bb66696a0345fcc9e3d6185ea49 to your computer and use it in GitHub Desktop.
import React from 'react';
function Spenses({ items }) {
function deleteItem({ id, amount }) {
// Delete the item.
}
return (
<>
{items.map((item, index) => (
<tr key={index}>
<a
href="#!"
onClick={() => deleteItem(item)}
>
Delete Item
</a>
</tr>
))}
</>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment