This is the fifth installment of a seven-part series designed to improve your React development skills. This project focuses on integrating Redux in React application. Here, we are using FakeStore API for dummy APIs.
Follow these instructions to get the application running:
- Install Node.js version 14.21.3:
nvm install v14.21.3
nvm use v14.21.3
- Install necessary packages:
npm install
- Start the application:
- To run the project :
npm start
- To run the project :
- CONSTANTS: Set up the ACTION TYPE, which defines the name of your action.
- ACTIONS: Specify the type and payload for actions based on user interactions or other events.
- REDUCERS:
- Develop individual reducers that manage specific pieces of state.
- Handle actions based on the ACTION TYPE provided.
- Use
combineReducers()
to merge all reducers into a single reducing function, as the Redux store accepts only one reducer.
- STORE:
- Create the Redux store with
createStore()
. - Enable Redux DevTools in the browser by including
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
as an argument when creating the store.
- Create the Redux store with
axios
: API calls are easily handled using thisreact-router-dom
: To handle routing in reactMaterialize CSS
redux
combineReducers():
to combine more than one reducercreateStore():
to create a store
react-redux
- : to provide a store variable to all the components inside of it
useSelector():
to extract varables in the storeuseDispatch():
to dispatch an action (to update the values of the variables in the store)
This project is part of a comprehensive React learning series: