June 2021
Intermediate to advanced
398 pages
9h 35m
English
We first need to install Redux, the Redux bindings for React, and their associated type definitions:
| | $ yarn add redux react-redux @types/redux @types/react-redux |
Then, we’ll create a Redux store in our app.
To create a store in our app, we’ll use the function provided by Redux called createStore, which takes a reducer function as its one argument. (There’s a Redux Toolkit library that has support for creating more complex stores and reducers. We won’t be using it in this book, but if you are building true single-page applications with Redux, you should definitely look at it.)[83]
The reducer we’ve been building in our page so far is almost exactly structured to work in Redux as is. The main ...