# immerjs/use-immer

Use immer to drive state with a React hooks

Repository: https://github.com/immerjs/use-immer
Canonical: https://ross.abutalabs.com/products/use-immer
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2024-12-17T11:16:07+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2869, "days_push": 624, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4548, forks 99 (observed 2026-08-28T04:08:53.272568+00:00)

## What it is
use-immer is a set of React hooks (useImmer, useImmerReducer) that wrap the Immer library for immutable state management. It lets you mutate a draft state directly while producing immutable next states, as a drop-in alternative to useState and useReducer.

## Use cases
- manage react state with immer
- update nested state without spread operators
- replace usestate with mutable draft updates
- use immer in a react reducer
- simplify immutable state updates in react components

## When to choose
- you want to write state updates as direct mutations while keeping immutability
- your components have deeply nested state that is painful to update immutably
- you already use immer and want a hooks-based API

## When to avoid
- your state is simple primitives where useState suffices
- you use a state management library like redux or zustand that already integrates immer
- you are not using react

## Facets
- artifact type: library
- maturity: stable
- function: state-management
- domain: frontend, web-development
- platform: browser
- tags: react-hooks, immer, immutable-state, typescript, nodejs

## Member repositories
- immerjs/use-immer (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:53.272568+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:05.902796+00:00, confidence not recorded.
  - readme: https://github.com/immerjs/use-immer (fetched 2026-08-28T04:08:53.272568+00:00, sha b6fc985b2869)
- Data as of 2026-08-30T08:39:29.467469+00:00.
