Created
November 25, 2019 21:57
-
-
Save shanebdavis/2cbf33f19cd3b5c863f8cbc3606f5159 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 from "react"; | |
import { useSelector, useDispatch } from "react-redux"; | |
import appActions from "./redux/actions/appActions"; | |
import ToDo from "./components/ToDo"; | |
import "./App.css"; | |
const App = () => { | |
const list = useSelector((store) => store.appReducer.list); | |
const dispatch = useDispatch(); | |
const redux_add = (todo) => dispatch(appActions.redux_add(todo)); | |
const redux_delete = (id) => dispatch(appActions.redux_delete(id)); | |
const props = { list, redux_add, redux_delete }; | |
return <ToDo {...props} />; | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment