Immer lets you write immutable state updates by mutating a proxy draft, eliminating Redux reducer boilerplate without adopting a new data structure library.
Key Takeaways
produce(currentState, draft => { ... }) records draft mutations and returns a structurally shared next state; unchanged nodes are reused.
No string paths, no DSL: updates use native JS array and object APIs, so TypeScript and Flow can infer types through deep mutations.
Auto-freeze in dev mode freezes only changed subtrees, making it efficient while catching accidental direct mutations at runtime.
Curried producers let you define a reducer as produce(draft => { ... }), cutting Redux reducer boilerplate to just the mutation logic.
Compared to ImmutableJS withMutations and similar tools, Immer requires no custom data structures or 67-package ecosystem shims.