Learn Redux - Latest Stable Features (RTK 2.x)
Series/Learn Redux/Episode 20
Episode 20 of 23

Learn Redux - Latest Stable Features (RTK 2.x)

This episode reviews the stable Redux Toolkit 2.x features: full ESM and CommonJS support, the TypeScript 5.4+ policy, Immer 10 with performance improvements, skills files for AI tooling, and the 2026 release notes from v2.11 to v2.12.0 including fetchBaseQuery and retry fixes.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

Redux Toolkit 2.x is a release unlike the 1.x series: it's a version built TypeScript-first, using Immer as the heart of state mutation, and removing legacy patterns that added complexity. Episode 20 guides you through what's stable and new in v2.x — so when you read a changelog or upgrade, you know which parts affect your code.

Some of the discussion is version-specific and will keep changing. That's why it's a good habit to verify against the registry before updating dependencies. We cover four areas: the module system and TypeScript, Immer 10, skills files for AI tooling, then a summary of the 2026 releases from v2.11 through v2.12.0.

v2.x Core Capabilities

Full ESM and CommonJS

RTK 2.x ships a dual-module build: ESM and CJS in a single package. Modern bundlers pick ESM for tree-shaking, while older environments still get CJS:

Verifikasi versi terpasang
npm view @reduxjs/toolkit version
Impor ESM modern
import { createSlice, configureStore } from "@reduxjs/toolkit"
import { setupListeners } from "@reduxjs/toolkit/query"

Node.js 20+ and the latest bundlers use ESM by default. In RTK 2.x, Redux core is also on version 5, which is ESM-first, so the entire dependency chain — from @reduxjs/toolkit to react-redux — runs consistently in a single module system.

TypeScript Support Policy

RTK 2.x sets a TypeScript version policy: supporting TypeScript 5.4 and above. This means RTK's source is written with TS 5.x features, and its type declarations use more expressive generics. The implications for your project:

  • TypeScript versions below 5.4 won't get accurate declarations.
  • tsconfig should use "moduleResolution": "bundler" so ESM types resolve correctly.
  • Features like satisfies and template literal types are freely usable in declarations.

Check your project's TypeScript version before upgrading to RTK 2.x:

Periksa versi TypeScript
npm ls typescript

Immer 10 and Performance Improvements

Faster Draft Mutation

Immer version 10 speeds up draft creation and state finalization. Because Redux Toolkit uses Immer for all reducers and updateQueryData, Immer's performance gains are directly felt in apps with large state updates:

JSReducer yang memanfaatkan Immer 10
updateAllUsers: (state, action) => {
  const stamp = action.payload
  for (const user of Object.values(state.users)) {
    user.lastSync = stamp
  }
}

Draft mutations like the one above are handled efficiently by Immer in version 10. There's no API change for you — just faster results and a smaller memory footprint when copying changes.

Verifying Performance in Your App

Claimed performance is best proven yourself:

Ukur waktu update state
console.time("updateMany")
store.dispatch(updateMany(listOfUsers))
console.timeEnd("updateMany")

Compare the timing before and after the Immer upgrade on a slice with large data. In most cases, the difference shows up in batch operations on hundreds to thousands of entities.

Skills Files for AI Tooling

Official Package Files Recognized by AI

Starting with the 2025-2026 release series, the Redux team ships skills files that AI-based coding tools can read — inspired by the TanStack Intent ecosystem. Skills files are structured markdown with guidance: when to use createAsyncThunk, recommended RTK Query patterns, and common mistakes to avoid:

Lokasi skills dalam paket
{
  "files": [
    "node_modules/@reduxjs/toolkit/skills/rtk-query.md",
    "node_modules/@reduxjs/toolkit/skills/async-thunk.md"
  ]
}

AI tools read these files while writing Redux code, so the output follows official conventions — not generic patterns that might be wrong. For large projects, keeping a copy of the skills in the repo as onboarding docs also helps the team.

2026 Release Notes

v2.11 to v2.12.0

The 2026 releases polish RTK Query and the overall experience:

  • Infinite query status flags: infinite query hooks now expose dedicated statuses like isFetchingNextPage, making it easy to show a next-page spinner without manual state.
  • Batching fixes: improvements in grouping state updates so subscriber notifications are more efficient and consistent.
  • Exported hook options types: the types of hook options like polling, refetch, and select are publicly exported — useful for writing typed wrapper hooks.
  • fetchBaseQuery and retry fixes: handling edge cases for non-2xx responses, missing headers, and the retry behavior for idempotent requests.

Here's an example of using the new status flags:

JSStatus infinite query di v2.12
const { data, isFetchingNextPage, fetchNextPage } =
  useGetPostsInfiniteQuery()
 
return (
  <>
    <button
      disabled={isFetchingNextPage}
      onClick={() => fetchNextPage()}
    >
      Muat lagi
    </button>
  </>
)

isFetchingNextPage distinguishes loading an additional page from the initial load — a small change that removes guesswork in the UI.

Keeping Dependencies Current

The versions written here will fall behind over time. The right habits:

Cek versi terbaru dan changelog
npm view @reduxjs/toolkit version
npm view @reduxjs/toolkit dist-tags

Read the official changelog on GitHub reduxjs/redux-toolkit before every minor upgrade. In particular, the breaking changes section — usually listed under the release heading with a warning label.

Tip

Do major-version upgrades in a separate PR rather than mixing them with feature changes. If your test suite is thorough like episode 18, the upgrade risk can be reduced to just a few files that need adjustment.

Conclusion

Redux Toolkit 2.x is the modern foundation for state management: full ESM and CommonJS, the TypeScript 5.4+ policy, Immer 10 with better performance, skills files for AI tools, and continuous improvements through the 2026 releases. Understanding the capabilities and release notes helps you use the right version and recognize it when reading the documentation.

Key takeaways:

  • RTK 2.x supports full ESM and CJS in a single package.
  • The support policy starts at TypeScript 5.4 and above.
  • Immer 10 speeds up draft creation and state finalization.
  • Skills files help AI tools write Redux code according to conventions.
  • v2.12 adds infinite query status flags and batching fixes.
  • Always verify the latest version via npm view and read the changelog before upgrading.

In the next episode, episode 21 closes the engineering side with production-ready architecture — you'll design architecture for large teams: feature-based slices, thunk and mutation writing standards, code review patterns, bundle size awareness, tree-shaking, error monitoring, and onboarding documentation.

Learn Redux - Latest Stable Features (RTK 2.x) | Learn Redux