September 2018
Beginner
156 pages
3h 28m
English
After creating a project using the create-react-app CLI, include the dependencies redux and react-redux dependencies:
npm install --save redux react-redux
The redux library includes the createStore, combineReducers, bindActionCreators, applyMiddleware, and compose helper functions; whereas the react-redux library includes Redux bindings that help your React components communicate with the Redux store.
The next step is to define actions that the user can initiate from the user interface. In our example, we will create a Counter component that can increment and decrement the counter value.
In actions/counter.js:
export const increment = () => ({ type: 'INCREMENT'});export const decrement = () => ({ type: 'DECREMENT'});
After ...
Read now
Unlock full access