Challenge: Installation of Redux ToolkitChallenge: Installation of Redux Toolkit

In this exercise, you will learn how to install Redux Toolkit and its required dependencies in a new React project.

Prerequisites

Before proceeding, please ensure you have installed Node.js and NPM on your computer. You can verify this by checking their versions. If you see version numbers, then you can proceed with the task. If not, please refer to the official Node.js documentation to install them on your machine.

Task

Step 1: Create a New React Project

Open your terminal. Create a new React project using Create React App. Run the following command:

Navigate to your project directory:

Step 2: Install Redux Toolkit and Dependencies

In your project directory, run the following command to install Redux Toolkit:

Redux Toolkit may require additional dependencies. Install them using the following command:

Step 3: Verify the Installation

  1. Open your code editor and navigate to the project directory of your React app.
  2. Check the package.json file in the root directory to ensure that the necessary dependencies are listed.
  3. You should see entries for @reduxjs/toolkit and react-redux under the dependencies section.

Step 4: Start the Development Server

  1. Return to your terminal.
  2. Start the development server by running:

Open your web browser and go to http://localhost:3000. You should see your React application running.

content

Everything was clear?

Section 1. Chapter 6