Download Latest Version v2.8.2 source code.tar.gz (3.4 MB)
Email in envelope

Get an email when there's a new version of Redux Toolkit

Home / v2.8.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-05-06 2.0 kB
v2.8.0 source code.tar.gz 2025-05-06 3.4 MB
v2.8.0 source code.zip 2025-05-06 3.9 MB
Totals: 3 Items   7.3 MB 0

This feature release improves React Native compatibility by updating our package exports definitions, and adds queryArg as an additional parameter to infinite query page param functions.

Changelog

Package Exports and React Native Compatibility

Expo and the Metro bundler have been adding improved support for the exports field in package.json files, but those changes started printing warnings due to how some of our package definitions were configured.

We've reworked the package definitions (again!), and this should be resolved now.

Infinite Query Page Params

The signature for the getNext/PreviousPageParam functions has been:

:::ts
(
    lastPage: DataType,
    allPages: Array<DataType>,
    lastPageParam: PageParam,
    allPageParams: Array<PageParam>,
  ) => PageParam | undefined | null

This came directly from React Query's API and implementation.

We've had some requests to make the endpoint's queryArg available in page param functions. For React Query, that isn't necessary because the callbacks are defined inline when you call the useInfiniteQuery hook, so you've already got the query arg available in scope and can use it. Since RTK Query defines these callbacks as part of the endpoint definition, the query arg isn't in scope.

We've added queryArg as an additional 5th parameter to these functions in case it's needed.

Other Changes

We've made a few assorted docs updates, including replacing the search implementation to now use a local index generated on build (which should be more reliable and also has a nicer results list uI), and fixing some long-standing minor docs issues.

What's Changed

Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/v2.7.0...v2.8.0

Source: README.md, updated 2025-05-06