Packages

@reduxjs/toolkit

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

Your version

2.2.0

12 Feb 2024Where it was published

2.13.0 is the newest release of 2.x.

In short

9 new4 fixed21 changed3 internal

Release note

This minor release:

  • Adds a second parameter to entityAdapter.getInitialState(additionalProps, entities) to allow prefilling state

    • Equivalent to entityAdapter.setAll(entityAdapter.getInitialState(additionalProps), entities)

    • First parameter can be undefined if no additional properties are desired

  • Allows initialising combineSlices with no static reducers

    • Previously const combinedReducer = combineSlices().withLazyLoadedSlices<LazyLoadedSlices>() would have thrown an error

    • Now returns a "no-op" reducer that just returns an empty object until first reducer injected

  • Allows a new 'throw' value for overrideExisting in injectEndpoints, which throws an error if a definition is injected with a name which is already used

  • Exports more type helpers for RTKQ hook and trigger types

  • Exports types related to overriding result types in enhanceEndpoints

  • Fixes state inference for injected slices when undeclared (i.e. not in LazyLoadedSlices)

  • Adds a action.meta.arg.isPrefetch value to query thunk actions when prefetched

What's Changed

  • Revamp type tests setup

  • Bump Prettier and Prettier related packages

  • Fix codemods to work with TypeScript 4.7+

  • Export types related to overriding the result types

  • Migrate type tests to Vitest

  • Fix RetryOptions type test by flipping order

  • Format all files

  • skipPollingIfUnfocused added to polling overview and query options

  • Temporarily revert node-fetch bump until ESM issues are sorted

  • Contributing Markdown Refresh

  • Investigate re-adding size limit action

  • Add size limit imports for more commonly used RTK exports

  • Pure some things

  • Cut back on suffixes tested for size

  • Incorrect builder method referenced

  • Rename cli.js to cli.mjs

  • Fix wrong state for injected slices when not declared via withLazyLoadedSlices

  • : add missing setOne and setMany signature

  • Corrected the "Observing cache behaviour" example point no.4

  • Add isPrefetch property in query action

  • Allow initialising combined slice reducer with no static slices

  • Create more Typed wrappers for RTKQ hook types

  • Proposal fix for axios base query types

  • Provide 'throw' option for overrideExisting

  • Use vite-tsconfig-paths to make path aliasing easier

  • Remove trailing commas in tsconfig.json files of all CodesandBox examples

  • Add second parameter to getInitialState to prefill entities