Redux Toolkit: how configureStore, createSlice and RTK Query reshape Redux code
The official, opinionated, batteries-included toolset for efficient Redux development
At a glance
- What is it?
- Redux Toolkit is the official package for writing Redux logic, bundling store setup, Immer-backed reducers, async helpers and the RTK Query data layer into @reduxjs/toolkit. It removes most Redux boilerplate, but it deliberately stays out of app structure and still commits you to Redux's store model.
- Who is it for?
- Adopt Redux Toolkit if you already use Redux or want a single global store with action history in the Redux DevTools: configureStore and createSlice remove the setup and switch-statement boilerplate, and RTK Query covers data fetching without a second library. Skip it if you want a store that does not route updates through actions and reducers, or if you expect the library to dictate folder layout or entity relationships, which it explicitly leaves to you.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 6 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.
Star history
- reduxjs/redux-toolkit11,249 ★ · +25
| Repository | 2026-09-22 | 2026-11-14 |
|---|---|---|
| reduxjs/redux-toolkit | 11.2k | 11.2k |
25 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Three complaints about Redux, and the scope the toolkit refuses to cover
Redux Toolkit exists because of three specific complaints its maintainers kept hearing: configuring a Redux store is too complicated, Redux needs a pile of extra packages before it does anything useful, and it demands too much boilerplate. The package is meant to be the standard way to write Redux logic, and it takes its cue from create-react-app: abstract the setup, handle the common cases, and ship utilities that shorten application code.
The flip side is stated just as plainly. The package is deliberately limited in scope and does not address reusable encapsulated Redux modules, folder or file structure, or managing entity relationships in the store. That has a real consequence for a team adopting it. Two codebases built on Redux Toolkit can look nothing alike, because the toolkit has no opinion about where a slice file lives or how a feature folder is laid out. If your team expected an adopted library to settle those arguments, it will not. createEntityAdapter normalizes a flat collection of records, but relationships between collections, such as posts that reference authors, remain your design problem.
configureStore wraps createStore and preloads thunk and the DevTools hookup
configureStore is the first API most projects touch. It wraps Redux's createStore with simplified options and defaults: it can combine your slice reducers automatically, add whatever middleware you supply, includes redux-thunk by default and enables the Redux DevTools Extension. The three packages a hand-rolled Redux setup used to pull in separately, a combineReducers call, the thunk middleware and the DevTools enhancer, collapse into one call.
combineSlices goes a step further. It merges several slices into one reducer and allows slices to be lazily loaded after the store is initialised. For a large single-page app split by route, that means a feature's state does not have to be registered at startup. A settings screen that most users never open can bring its slice with it when the route loads.
The DevTools connection matters more than it first appears. Because every state change goes through a dispatched action, the Redux DevTools browser extension can show a timeline of actions and replay it, and RTK Query requests and cache updates appear on that same timeline.
createSlice turns mutating syntax into immutable updates through Immer
The core of day-to-day Redux Toolkit code is createSlice, which combines two lower-level APIs. createReducer accepts a lookup table that maps action types to case reducer functions, replacing the classic switch statement. createAction generates an action creator for a type string, and that function defines toString(), so it can stand in wherever a type constant used to go.
createSlice takes a slice name, an initial state value and an object of reducer functions, and generates the slice reducer together with matching action creators and action types. You no longer write a constants file, an action creators file and a reducer file for each feature.
Inside those reducers, the immer library runs automatically. That lets you write a line such as state.todos[3].completed = true, which reads like a direct mutation, while Immer produces a new immutable state object behind it. This is the single largest reduction in boilerplate the toolkit offers: nested spread expressions three levels deep become one assignment. It also changes how code reviews read, since a reducer that looks like it mutates state is correct by design inside createSlice.
Redux Toolkit install for new apps: the Vite, Next.js and Expo templates
For a new React app, the recommended start is a template that already wires up Redux Toolkit and React-Redux for its build tool and includes a small example app. The Vite template is the official Redux plus TypeScript one, cloned with the tiged tool. Next.js has its own with-redux example:
# Vite with our Redux+TS template
npx tiged reduxjs/redux-templates/packages/vite-template-redux my-app
# Next.js using the `with-redux` template
npx create-next-app --example with-redux my-appEither command produces a my-app directory with the store already configured, so the first real task is reading the example slice and replacing it with your own. For React Native, there is an official Redux plus TypeScript template for Expo:
npx tiged reduxjs/redux-templates/packages/expo-template-redux-typescript my-appThe templates are the path of least friction because the store, the React-Redux wiring and the TypeScript setup are already in place. Teams that already have a Next.js or Vite project will not get much from them beyond a reference to copy from.
Adding it to an existing app, and the import map the browser build needs
An existing project takes the package from npm, for use with a module bundler or in a Node application:
# NPM
npm install @reduxjs/toolkit
# Yarn
yarn add @reduxjs/toolkitThat one package carries configureStore, createSlice, the async helpers and RTK Query. React bindings come from react-redux, which is a separate package. If you work with an AI coding agent, the project also offers agent skills through npx @tanstack/intent@latest install, and the repository has a top-level skills/ directory.
The no-bundler route has a catch. The package ships a precompiled browser ESM build that can be loaded from a script type="module" tag, but that build imports Redux Toolkit's own dependencies by package name. A browser cannot resolve a bare package name on its own, so loading the file alone fails until you add an import map that points each dependency at a URL. For a quick prototype in a single HTML file, that extra step is the difference between pasting one tag and maintaining a mapping of several packages. The Getting Started page on redux-toolkit.js.org carries the example.
createAsyncThunk and the listener middleware replace hand-written side effects
Async work in Redux sits outside reducers, in middleware. createAsyncThunk takes an action type string and a function that returns a promise, and generates a thunk that dispatches pending, then resolved or rejected actions as the promise settles. Your slice handles those three action types to set a loading flag, store the result or record the error. Because redux-thunk is already in the store configureStore builds, nothing extra needs installing.
For logic that reacts to what happens in the store rather than starting a request, createListenerMiddleware defines listener entries. Each holds an effect callback plus a rule for when it runs, based on dispatched actions or state changes. The project positions it as a lightweight alternative to Redux async middleware such as sagas and observables. For a team weighing redux-saga, the difference is a dependency: the listener middleware is part of @reduxjs/toolkit, while sagas need their own package and their own middleware registration.
Two smaller utilities round this out. createEntityAdapter generates reusable reducers and selectors for normalized data, and createSelector from the Reselect library is re-exported so memoized selectors need no separate install.
RTK Query ships in the same package behind its own entry points
RTK Query is the optional data fetching and caching layer, and it arrives with the core install. You reach it through one of two entry points:
import { createApi } from '@reduxjs/toolkit/query'
import { createApi } from '@reduxjs/toolkit/query/react'The React-specific entry point generates hooks for each endpoint you define, so a component calls a hook instead of dispatching a thunk and selecting the result. createApi is the core: you describe a set of endpoints and RTK Query handles the request, caching and loading state that teams otherwise write by hand.
The design has a cost worth naming. RTK Query is built on the Redux Toolkit core and uses Redux internally. Knowledge of Redux is not required to use it, but the cache lives in a Redux store, so adopting RTK Query in an app with no Redux means adding a store, a reducer and middleware to host it. Teams that want data fetching only, and nothing else from Redux, carry that store whether they use it or not. In exchange, every request and cache update shows up in the Redux DevTools timeline.
Where Zustand differs, and what the release history says about upkeep
Zustand is the alternative most often weighed against Redux Toolkit. Zustand defines a store as a hook holding state and the functions that change it, called directly, with no action objects or reducers in between. Redux Toolkit keeps the action and reducer model and trims its ceremony. The choice comes down to whether you want the action log: if replaying a timeline of dispatched actions in the DevTools matters to you, Redux Toolkit keeps it. If you never open that timeline, Zustand asks for less code per feature.
On maintenance, the repository is current. The last push was on 2026-11-02, and recent releases are v2.13.0 on 2026-09-29, v2.12.0 on 2026-05-15 and v2.11.2 on 2025-12-14. The code is a pnpm monorepo, with packages under packages/ and runnable samples in examples/ such as action-listener and query. The root package.json pins TypeScript 6 and React 19 as development dependencies, and lint runs through oxlint on packages/toolkit/src. Redux Toolkit is released under the MIT license, so there is no copyleft obligation on applications that bundle it.
Editorial conclusion
Adopt Redux Toolkit if you already use Redux or want a single global store with action history in the Redux DevTools: configureStore and createSlice remove the setup and switch-statement boilerplate, and RTK Query covers data fetching without a second library. Skip it if you want a store that does not route updates through actions and reducers, or if you expect the library to dictate folder layout or entity relationships, which it explicitly leaves to you. Before committing, decide whether RTK Query from @reduxjs/toolkit/query/react replaces your current fetching layer, and if you plan to load the package without a bundler, set up the import map the browser ESM build requires.
Frequently asked questions
What is Redux Toolkit?
Redux Toolkit is the official, opinionated toolset for writing Redux logic, published as @reduxjs/toolkit. It bundles configureStore, createSlice, createAsyncThunk, createEntityAdapter and the RTK Query data fetching layer.
How do I install Redux Toolkit?
In an existing project, run npm install @reduxjs/toolkit or yarn add @reduxjs/toolkit. For a new React app, the recommended start is the official Vite Redux plus TypeScript template or Next.js's with-redux example.
How do I use Redux Toolkit in Next.js?
The suggested route is to create a new project with npx create-next-app --example with-redux my-app. That template ships with Redux Toolkit and React-Redux already configured and a small example app.
How do I use a thunk in Redux Toolkit?
configureStore includes redux-thunk by default. createAsyncThunk takes an action type string and a function returning a promise, and generates a thunk that dispatches pending, resolved and rejected actions.
How do I use RTK Query with Redux Toolkit?
RTK Query is included in the @reduxjs/toolkit package. Import createApi from @reduxjs/toolkit/query, or from @reduxjs/toolkit/query/react to get generated hooks for each endpoint.
How do I use createSelector with Redux Toolkit?
Redux Toolkit re-exports createSelector from the Reselect library, so you import it from @reduxjs/toolkit without installing Reselect separately.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/reduxjs-redux-toolkit)Star history chart for your README
[](https://hysenlabs.com/projects/reduxjs-redux-toolkit)Was this useful?