Summary
Upgrade the Redux ecosystem to the latest major versions. The project currently uses RTK 1.x which is significantly behind the modern Redux patterns introduced in RTK 2.x.
Current → Target
| Package |
Current |
Latest |
@reduxjs/toolkit |
1.8.6 |
2.x |
react-redux |
8.0.4 |
9.x |
redux |
4.2.0 |
5.x |
redux-thunk |
2.4.1 |
3.x (bundled in RTK 2.x) |
Why Upgrade
- RTK 2.x introduces improved TypeScript support, better defaults, and the new
listenerMiddleware
react-redux 9.x has performance improvements and drops legacy context usage
- Redux 5.x is a TypeScript rewrite with improved types
redux-thunk is bundled in RTK 2.x — no longer needed as a separate dependency
Migration Steps
- Upgrade all packages together — these are tightly coupled:
yarn add @reduxjs/toolkit@latest react-redux@latest redux@latest
yarn remove redux-thunk
- Review
configureStore usage — RTK 2.x changes some defaults:
redux-thunk is included automatically — remove manual middleware addition
serializableCheck and immutabilityCheck are on by default
- Update
createSlice usage — check for deprecated patterns:
createSlice reducers now support a builder callback (preferred)
- Check any
extraReducers using the map object notation → switch to builder
- Fix TypeScript types — RTK 2.x exports improved types:
RootState and AppDispatch inference should still work but verify
useSelector and useDispatch hooks may need typed versions
- Run tests —
yarn ci to ensure all 435 tests still pass
Files Likely Affected
app/ducks/ — all Redux slices and store configuration
- Any component using
useSelector/useDispatch
- Store setup file (likely
configureStore call)
References
Summary
Upgrade the Redux ecosystem to the latest major versions. The project currently uses RTK 1.x which is significantly behind the modern Redux patterns introduced in RTK 2.x.
Current → Target
@reduxjs/toolkitreact-reduxreduxredux-thunkWhy Upgrade
listenerMiddlewarereact-redux9.x has performance improvements and drops legacy context usageredux-thunkis bundled in RTK 2.x — no longer needed as a separate dependencyMigration Steps
configureStoreusage — RTK 2.x changes some defaults:redux-thunkis included automatically — remove manual middleware additionserializableCheckandimmutabilityCheckare on by defaultcreateSliceusage — check for deprecated patterns:createSlicereducers now support a builder callback (preferred)extraReducersusing the map object notation → switch to builderRootStateandAppDispatchinference should still work but verifyuseSelectoranduseDispatchhooks may need typed versionsyarn cito ensure all 435 tests still passFiles Likely Affected
app/ducks/— all Redux slices and store configurationuseSelector/useDispatchconfigureStorecall)References