State

state/redux-toolkit

New and maintained Redux code uses Redux Toolkit's configureStore and createSlice, not the legacy createStore.

minorstaticfe-state

Why

The Redux maintainers consider the bare redux core obsolete for app code. A store built with createStore misses the development checks that configureStore adds (accidental mutation, values that cannot be serialised), and hand-written action types, action creators and immutable updates are where most Redux bugs live.

Fix

Replace createStore(rootReducer) with configureStore({ reducer: { … } }) from @reduxjs/toolkit, then move reducers to createSlice one at a time. Server data belongs in RTK Query or TanStack Query rather than in hand-written thunks and slices.

Examples

// bad
import { createStore, combineReducers } from 'redux'
export const store = createStore(combineReducers({ todos }))
// good
import { configureStore } from '@reduxjs/toolkit'
export const store = configureStore({ reducer: { todos } })

Sources

Facts

Id
state/redux-toolkit
Severity
minor
Check
static checked in the source by audit
Applies to
jsx
Only in projects with
redux
Taught by the skill
fe-state State and stores
Since version
0.1.0

Rule file on GitHub

Read it in the terminal

npx github:dawidolko/frontend-skills explain state/redux-toolkit