Installing Redux
Before we can use Redux, we need to install it, along with the TypeScript types. Let's perform the following steps to install Redux:
- If we haven't already done so, let's open our project in Visual Studio Code from where we left off in the previous chapter. We can install the core Redux library via the terminal with the following command:
> 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.
- Now, let's install the React-specific bits for Redux in the terminal with the following command:
> npm install react-redux
These bits allow us to connect our React components to the Redux store.
- Let's also install the TypeScript types for React Redux:
> npm install @types/react-redux --save-dev
With all the Redux bits now installed, we can start to build our Redux store.