Last active
June 23, 2019 22:14
-
-
Save greaveselliott/30278c6382f00f81f1f7e18f03567baf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useContext } from "react"; | |
import { Store } from "./Store"; | |
import { createNewListItem, deleteListItem } from "./Actions"; | |
import "./app.scss"; | |
export default function App() { | |
const { state, dispatch } = useContext(Store); | |
const input = useRef(); | |
const onDeleteListItem = uuid => { | |
deleteListItem({ | |
dispatch, | |
payload: { | |
uuid | |
} | |
}); | |
}; | |
return ( | |
//... | |
<button onClick={() => deleteListItem(listItem.uuid)}> | |
Delete | |
</button> | |
//... | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment