This project replaces Redux from Redux ToDo App with React Hooks
- This project was created for a talk at Seattle ReactJS December 2018 Meetup
- Slides of the talk can be viewed here
- Video of the talk can be viewed here
- It was bootstrapped with Create React App.
- Fork this repo
- Clone it on your machine
- Run
yarn
ornpm install
to install dependencies - Run
yarn start
ornpm run start
to start the server
- Replace
combineReducers
with a function to remove dependency onredux
inreducers/index.js
(doc) - Create StoreContext which returns createContext (doc)
- Create Store using this StoreContext which creates Provider with useReducer
- Comment
VisibleTodoList
andFooter
inApp.js
, uncomment them while working on each - Remove redux from AddToDo, and use dispatch from useContext
- Remove redux from VisibleTodoList, and use [state, dispatch] from useContext
- Remove redux from Footer, and use [state, dispatch] from useContext
- Remove redux and react-redux from the project!
- Doing it by following the steps will help you learn React Hooks. If you want help for specific steps, the experimental commits can be viewed in hooks branch
- Single commit which removes redux in favor of React Hooks can be viewed in hooks-final branch