Redux allows you to manage the state of the application via a unidirectional flow where a child component child component can directly access the state from the redux store instead of getting state changes from parent components.
I am assuming you have basic knowledge of React and an understanding of what Redux is used for. Without further ado, let’s get straight into the action.
This is an ideal react-redux app project structure.
Below is a typical workflow of a react app. We will go through each of the steps below in more detail.
React-Redux in 4 steps — Medium: @heypb , Insta: h3ypb
Let’s see how that flow will occur.
actions/printHelloAction.js
reducers/pringHelloWorldReducer.js
All reducers of a react app are combined into one single reducer which is passed as an argument to the redux store.
reducers/index.js
The redux store is provided to the react app in the root component.
src/index.js
So a more detailed flow may look like this,
react-redux flow
The Gitub for the above code samples can be found here, if you want to go through the code to see how it all fits together.
There are certain things that you should keep in mind while working in react-redux-
Hope you have gained an understanding of a basic react-redux application workflow.
Cheers! Happy Day!
Feel free to add me on LinkedIn and on Instagram!
There are many important concepts that you might want to know if you want to go advance, refer the below links
uanders/react-redux-cheatsheet_React Redux Cheat Sheet on Workflow & Concept. Contribute to uanders/react-redux-cheatsheet development by creating an…_github.com
Why do we need middleware for async flow in Redux?_According to the docs, “Without middleware, Redux store only supports synchronous data flow”. I don’t understand why…_stackoverflow.com
Presentational and Container Components_You’ll find your components much easier to reuse and reason about if you divide them into two categories._medium.com
Why do we need middleware for async flow in Redux?_According to the docs, “Without middleware, Redux store only supports synchronous data flow”. I don’t understand why…_stackoverflow.com