Before we can use Redux, we need to install it along with the TypeScript types. We will also install an additional library called redux-thunk, which we need in order to implement asynchronous actions:
- If we haven't already, let's open our React shop project in Visual Studio Code from where we left off in the last chapter. So, let's install the core Redux library via npm in the terminal:
npm install redux
Note that the core Redux library contains TypeScript types within it. So, there is no need for an additional install for these.
- Let's now install the React-specific bits for Redux. These bits allow us to connect our React components to the Redux store. Let's install these via npm:
npm install react-redux
- Let's also install the TypeScript types for react-redux:
npm install --save-dev @types/react-redux
- Let's install redux...