Key Concepts

Review core concepts you need to learn to master this subject

Redux Toolkit

Redux Toolkit, also known as the @reduxjs/redux-toolkit package, contains packages and functions that are essential for building a Redux app. Redux Toolkit simplifies most Redux tasks like setting up the store, creating reducers and performing immutable updates.

The Redux Toolkit
Lesson 1 of 1
  1. 1
    You’ve seen how verbose working with Redux can be. If you think there are a lot of moving parts and semantics to remember, you’re not alone. Some common issues/complaints people have when using Re…
  2. 2
    Before you can take advantage of the benefits of the Redux Toolkit, you must first install the @reduxjs/toolkit package into your application. You can do this with the Node Package Manager. While …
  3. 3
    Before we dive deeper into this lesson, let’s refresh our memory about what we’re referring to when talking about a “slice” of state. A normal Redux application has a JS object at the top of its s…
  4. 4
    In the last exercise, we looked at one way to define a slice reducer and the associated action creators. /* todosSlice.js */ const addTodo = (todo) => { // logic omitted… } const toggleTodo =…
  5. 5
    Because Redux reducers must never mutate state, we often write immutable updates by using JavaScript’s array and object spread operators and other functions that return copies of the original value…
  6. 6
    So far we’ve taken a look at the object that is passed to createSlice(), but what exactly does it return? Using todosSlice from the previous exercise as an example, createSlice() would return an o…
  7. 7
    Let’s now take a closer look at reducer in the return object of createSlice(). const options = { // options fields omitted. } const todosSlice = createSlice(options); /* Object returned by todo…
  8. 8
    Redux Toolkit has a configureStore() method that simplifies the store setup process. configureStore() wraps around the Redux library’s createStore() method and the combineReducers() method, and han…
  9. 9
    Congratulations! You were able to apply a couple of Redux Toolkit’s essential methods in order to refactor and simplify some existing Redux logic. * Redux Toolkit (RTK) contains pack…

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo