@reduxjs/toolkit
The official, opinionated Redux toolset — cuts the boilerplate and bakes in best practices.
@reduxjs/toolkit
ReactThe official, opinionated Redux toolset — cuts the boilerplate and bakes in best practices.
Fit
Bundle (gzip)
13.6 kB
37.0 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
Classic Redux earned a reputation for ceremony: action type constants, hand-written immutable reducers, thunk setup, and a pile of files just to update one value. Teams spent more time on plumbing than on features.
What It Does
Redux Toolkit is the batteries-included way to write Redux. configureStore sets up the store with sensible defaults, and createSlice generates actions and reducers together while letting you write "mutating" logic that Immer converts to safe immutable updates. RTK Query adds a full data-fetching and caching layer on top.
Installation
npm install @reduxjs/toolkit react-reduxUsage Example
import { createSlice, configureStore } from '@reduxjs/toolkit';
const counter = createSlice({
name: 'counter',
initialState: { value: 0 },
reducers: {
increment: (state) => { state.value += 1; },
addBy: (state, action) => { state.value += action.payload; },
},
});
export const { increment, addBy } = counter.actions;
export const store = configureStore({ reducer: { counter: counter.reducer } });Related packages
Fast, composable command palette for React — keyboard-driven search UI with fuzzy filtering and accessible markup out of the box.
@dnd-kit/coreReactModern, accessible drag-and-drop toolkit for React — fully customizable with keyboard support, collision detection, and zero dependencies.
embla-carousel-reactReactLightweight, extensible carousel library for React — smooth scrolling, touch/mouse drag, and full CSS control without prescribing markup.
flagsReactProvider-agnostic feature flags SDK for Next.js and React — toggle features without redeploying.
framer-motionReactProduction-ready declarative animation library for React — gestures, layout animations, and scroll-driven effects with a clean API.