Packages

@reduxjs/toolkit

2.13.0 · 29 Sep 2026MIT45.8M / weekRepositoryHomepagenpmAtom feed

Your version

2.2.8

8 Oct 2024Where it was published

2.13.0 is the newest release of 2.x.

In short

2 new2 fixed3 changed

Release note

This bugfix release fixes a long-standing issue with RTK Query lazy query triggers returning stale data in some cases, fixes an error handling issue in RTK Query, and exports additional TS types.

Changelog

Lazy Query Trigger Handling

We'd had a couple long-standing issues reporting that const result = await someLazyQueryTrigger() sometimes returned stale data, especially if a mutation had just invalidated that query's tag.

We finally got a good repro of this issue and identified it as a mis-written call inside of the middleware that skipped past the necessary handling to activate the correct query status tracking in that scenario. This should now be fixed.

Other Changes

Timeout handling in RTKQ endpoints should now correctly throw a timeout-related error instead of an AbortError.

Base queries now have access to the current queryCacheKey value so it can be used in deciding query logic.

We've exported several more TS types related to query options, as some users have been depending on those even though they previously weren't part of the public API.

What's Changed

  • Export QueryExtraOptions and MutationExtraOptions

  • Fix mangleErrors not preserving different error types

  • Add the TypedUseQueryStateOptions helper type

  • baseQuery: Expose queryCacheKey in baseQuery

  • Fix AbortError being triggered incorrectly on createApi endpoint timeout

  • type: Export QueryReturnValue

  • Call initiate to refetch queries from middleware