@reduxjs/toolkit
2.13.0 · 29 Sep 2026MIT45.8M / weekRepositoryHomepagenpmAtom feed
Upgrading @reduxjs/toolkit From 1.9.7 to 2.0.0
1 release in betweenevery note read
Reading releases, release notes and advisories…
- 8
- changes to make
- 0
- advisories fixed
- 24
- new
- 19
- fixes
Start here
Before you upgrade
Tick each one off as you go- breaking2.0.0
- breaking2.0.0
- breaking2.0.0
- breaking2.0.0
- breaking2.0.0
- breaking2.0.0
- breaking2.0.0
- breaking2.0.0
Release by release
- breaking
Removes the deprecated object syntax from
createSliceandcreateReducer - breaking
Removes other deprecated options
- breaking
This release has breaking changes. (Note: v2.0.1 was released with a couple hotfixes for Reselect and Redux Thunk right as this was being finalized.)
- breaking
For full details on all of the breaking changes and other significant changes to all of those packages, see the "Migrating to RTK 2.0 and Redux 5.0" migration guide in the Redux docs.
- breaking
62 other lines we could not sort, mostly version bumps
- 2.0.0
Updates the
middlewareandenhancersoptions ofconfigureStoreto require callbacks - 2.0.0
Updates the packaging for better ESM/CJS compatibility and modernizes the build output
- 2.0.0
Includes all changes to Redux core 5.0, Reselect 5.0, and Redux Thunk 3.0
- 2.0.0
Updates RTKQ default subscription behavior
- 2.0.0
Has many additional TS tweaks and improvements
- 2.0.0
It wasn't clear what the syntax for declaring a thunk inside should look like.
- 2.0.0
Thunks have access to
getStateanddispatch, but theRootStateandAppDispatchtypes are normally inferred from the store, which in turn infers it from the slice state types. Declaring thunks insidecreateSlicewould cause circular type inference errors, as the store needs the slice types but the slice needs the store types. We weren't willing to ship an API that would work okay for our JS users but not for our TS users, especially since we want people to use TS with RTK. - 2.0.0
You can't do synchronous conditional imports in ES modules, and there's no good way to make the
createAsyncThunkimport optional. EithercreateSlicealways depends on it (and adds that to the bundle size), or it can't usecreateAsyncThunkat all. - 2.0.0
In order to create async thunks with
createSlice, you specifically need to set up a custom version ofcreateSlicethat has access tocreateAsyncThunk. - 2.0.0
You can declare thunks inside of
createSlice.reducers, by using a "creator callback" syntax for thereducersfield that is similar to thebuildcallback syntax in RTK Query'screateApi(using typed functions to create fields in an object). Doing this does look a bit different than the existing "object" syntax for thereducersfield, but is still fairly similar.
6 internal lines (docs, tests, tooling) left out.