Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Installing Redux Toolkit | Getting Started with Redux Toolkit
State Management with Redux Toolkit in React

book
Challenge: Installing 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.

python
node -v
npm -v

Task

Step 1: Create a New React Project

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

python
npx create-react-app my-redux-app

Navigate to your project directory:

python
cd my-redux-app

Step 2: Install Redux Toolkit and Dependencies

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

python
npm install @reduxjs/toolkit

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

python
npm install react-redux

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:
python
npm start

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

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 6
some-alt