React-Redux for the Uninitiated (feat. Redux-Saga) — Part 2

zhifei
CodeX
6 min readJan 6, 2021

--

Part 1: https://medium.com/codex/react-redux-for-the-uninitiated-feat-redux-saga-part-1-8cff10003e00

I’ve added a repo for the source material of this series, check it out here: https://github.com/zhifez/react-redux-for-the-uninitiated

In Part 2, we’ll focus on setting up Redux in a React project.

Let’s start by creating a React project using the create-react-app:

$ create-react-app test-project

Then, install the following libraries:

$ yarn add redux react-redux redux-saga

Open the folder in your IDE and clear out all the codes in App.js (located at the root folder), and replace it with the following:

By default updateTodo, deleteTodo and createNewTodo are empty functions and will be updated later. It should be able to run without any issue.

File Hierarchy

My goto file hierarchy is to have a Redux specific folder that stores all the actions

--

--

zhifei
CodeX
Writer for

Software engineer. Jack of all stacks, master of none.