Skip to content

Instantly share code, notes, and snippets.

@shanebdavis
Created November 25, 2019 21:57
Show Gist options
  • Save shanebdavis/2cbf33f19cd3b5c863f8cbc3606f5159 to your computer and use it in GitHub Desktop.
Save shanebdavis/2cbf33f19cd3b5c863f8cbc3606f5159 to your computer and use it in GitHub Desktop.
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