@reduxjs/toolkit
2.15.0 · 18 Nov 2026MIT51.3M / weekRepositoryHomepagenpmAtom feed
Upgrading @reduxjs/toolkit From 2.13.0 to 2.15.0
2 releases in betweenevery note read
Reading releases, release notes and advisories…
- 3
- changes to make
- 0
- advisories fixed
- 0
- new
- 6
- fixes
Before you upgrade
Tick each one off as you go- Breaking2.14.0
- Deprecated2.15.0
- Deprecated2.14.0
Release by release
- Deprecated
The hooks use
isSubscribed()now, and don't dispatch anything to check subscriptions. Theinternal_getRTKQSubscriptionsaction is deprecated. It still works in 2.x, but logs a one-time dev warning and will be removed in 3.0. - Fixed
refetchOnMountOrArgChange: 0andforceRefetch: 0now always refetch. Before,0disabled the option. - Fixed
refetchOnFocusandrefetchOnReconnectrefetch a shared query if any subscriber's own or inherited setting istrue. One subscriber'sfalseno longer turns it off for the others. - Fixed
Polling skips while unfocused only if every polling subscriber sets
skipPollingIfUnfocused. Non-polling subscribers don't affect this.
- Deprecated
- Breaking
Note that we just announced our roadmap to Redux Toolkit 3.0, which includes both a large set of planned 2.x features and improvements, and planned 3.0 breaking changes.
- Deprecated
ApiRootStatereplaces RTK Query'sRootStatetype, which is now deprecated.RootStatewill be removed in 3.0. - Fixed
TypedAddListenerActionandTypedRemoveListenerActiondescribe the actions thataddListenerandremoveListeneractually dispatch. The default payload type ofTypedAddListenerandTypedRemoveListeneris now the listener options object, soaddListener.match(action)no longer claimsaction.payloadhas fields likeidandunsubscribethat don't exist at runtime. - Fixed
dispatch(removeListener(...))is typed as returningbooleananddispatch(clearAllListeners())as returningvoid, matching the runtime. - Fixed
UseQueryStateDefaultResultandUseInfiniteQueryStateDefaultResultare exported from@reduxjs/toolkit/query/react, for wrapping hooks with a genericselectFromResult.
- Breaking
10 other lines we could not sort, mostly version bumps
- 2.15.0
Removing a cache entry while its request runs now aborts that request. This covers
removeQueryResult, a lazy query'sreset(), cache collection, andresetApiState. Theinitiate()promise resolves withisError: trueand anAbortErrorwhose message is'removed'or'reset'. That meansunwrap()now rejects in this case, where it used to resolve with stale or missing data. The plain promise still never rejects. - 2.15.0
queryFulfilledinonQueryStartedrejects in the same case. If youronQueryStarteddoesawait queryFulfilledwithout atry/catch, you'll now get an unhandled rejection when the entry is removed mid-request. Wrap it: - 2.15.0
Invalidating an entry that has a running request (by tags, or a focus/reconnect refetch) now waits for that request to finish. The running request's promise gets its own result, and then the entry refetches if it has subscribers, or is removed if it doesn't.
- 2.15.0
A refetch while a request is running joins that request instead of starting another one.
initiate()also joins a runningupsertQueryData. - 2.15.0
A
pendingentry restored from persisted state, with no request actually running, now fetches again. - 2.15.0
A negative numeric
pollingIntervalnow means "no polling". Before, it re-polled immediately in a loop. - 2.15.0
'payload.options.pollingInterval'is a new default entry in the serializability check'signoredActionPaths. If you pass your ownignoredActionPaths, you'll need to add it. - 2.15.0
SubscriptionOptions['pollingInterval']is nownumber | ((entry) => number), so code that reads it as anumberneeds a type check. There's a new exportedPollingIntervaltype. - 2.15.0
api.util.getMiddlewareState()is a thunk that returns read-only access to what the middleware tracks for that store (currentlygetSubscriptionCount(queryCacheKey)), orundefinedif the middleware isn't added (#5501). - 2.15.0
Query
initiate()results have anisSubscribed()method.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.