Skip to content

Instantly share code, notes, and snippets.

@JeromeFranco
Last active July 7, 2019 08:44
Show Gist options
  • Save JeromeFranco/a0664458aac175386d99d74dd4fa6359 to your computer and use it in GitHub Desktop.
Save JeromeFranco/a0664458aac175386d99d74dd4fa6359 to your computer and use it in GitHub Desktop.
const TodoItem = ({ todo, onDelete, canDelete }) => {
return (
<div>
<div>{todo.desc}</div>
<div>
<button disabled={!canDelete} onClick={() => onDelete(todo)} />
</div>
</div>
);
};
TodoItem.propTypes = {
todos: PropTypes.object,
onDelete: PropTypes.func,
canDelete: PropTypes.bool,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment