OSS TanbouSign in with GitHub

framework-agnostic state utility that turns mutation-style recipes into structurally shared immutable next states

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
28,983
Primary language
JavaScript
License
MIT
Repository last updated
Oct 2, 2026
On this page

Overview

Immer runs mutation-style recipe functions against proxy drafts and produces a new immutable state reflecting those changes. Unchanged branches remain structurally shared, so nested immutable updates can be expressed without hand-written deep copies. It is commonly used in React and Redux state-management code but is not framework-specific.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Create immutable next state with mutation-style produce recipes

produce(base, recipe) gives the recipe a draft and derives the next state from mutations applied to that draft while leaving the base state unchanged.

Sources: [1][2]

Structurally share unchanged branches

Objects and arrays not changed through the draft can remain shared with the original state, avoiding manual whole-tree deep copies for nested updates.

Sources: [2]

Enable patches, Map/Set support, and manual drafts when needed

The public API includes produceWithPatches, applyPatches, enableMapSet, and createDraft/finishDraft for more advanced update workflows.

Sources: [2]

Best fit

Fits reducers and nested state updates that must remain immutable

It is useful with React state, Redux reducers, and other application state machines where repeated spread-based copies would otherwise make update logic verbose.

Sources: [1]

Before adoption

Immer is framework-agnostic and does not provide React subscriptions or a store

Immer transforms state values; it does not manage component subscriptions or application stores, so React integrations still rely on useState/useReducer or an external store.

Sources: [1][2]

Version 11.1.21 throws on reads from revoked Map or Set drafts

The release fixes behavior around revoked Map/Set drafts so reads fail explicitly rather than continuing with invalid draft access.

Sources: [3]

Official sources

  1. [1]Immer v11.1.21 README(2026-10-05)
  2. [2]Immer v11.1.21 produce exports(2026-10-05)
  3. [3]Immer v11.1.21 release(2026-10-05)
  4. [4]Immer MIT license(2026-10-05)
Supplemental curator note

Immer is framework-agnostic rather than React-specific and is already used internally by tools such as Redux Toolkit. Check whether the application needs a direct dependency.

Try it in 3 steps

  1. 1

    Install pinned Immer 11.1.21

    Create an isolated npm project with the reviewed Immer release pinned.

    demo=$(mktemp -d "${TMPDIR:-/tmp}/immer.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact immer@11.1.21
  2. 2

    Verify the package version

    Require npm package metadata to match the reviewed version.

    test "$(node -e "console.log(require('immer/package.json').version)")" = '11.1.21'
  3. 3

    Verify base and next state with produce

    Require the base state to remain unchanged while the recipe updates only the next immutable state.

    test "$(node --input-type=module -e "import {produce} from 'immer'; const base={todo:{done:false}}; const next=produce(base,d=>{d.todo.done=true}); console.log(base.todo.done+':'+next.todo.done)")" = 'false:true'
Check the official README

Growth

Growth trends · Last 30 days

28,983 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
12
Open PRs
13

Development activity is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • immutable
  • immutables
  • reducer
  • redux
  • state-tree
Stars
28,983
Forks
888
Watchers
151
Open issues
30
Contributors
209
Owner type
Organization
Primary language
JavaScript
License
MIT
Repository last updated
Oct 2, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?