# dai-shi/use-context-selector

React useContextSelector hook in userland

Repository: https://github.com/dai-shi/use-context-selector
Canonical: https://ross.abutalabs.com/products/use-context-selector
Homepage: https://www.npmjs.com/package/use-context-selector
Language: TypeScript
License: MIT
License Family: permissive
Topics: react, react-hooks, react-context, custom-hook
Last push: 2026-06-08T21:45:37+00:00

## Health v2 (maintenance only)
Score: 71/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 86, release rhythm 35, longevity 100
- inputs: {"age_days": 2616, "days_push": 86, "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 2961, forks 62 (observed 2026-08-28T04:07:32.339136+00:00)

## What it is
A small React library providing a useContextSelector hook in userland, allowing components to select parts of a context value to avoid unnecessary re-renders. It emulates the proposed React Context selector API with support for Concurrent React.

## Use cases
- avoid re-renders when using React Context
- select specific fields from context value in a component
- replace prop drilling with performant context
- use context with concurrent React rendering
- optimize large React apps with shared context state

## When to choose
- you specifically need context-selector semantics matching React's concurrent behavior
- you want a drop-in userland implementation of the proposed useContextSelector RFC
- you're a library author needing selector-based context in a peer dependency

## When to avoid
- you only want to avoid re-renders and don't care about context semantics - prefer Zustand or useSyncExternalStore
- you want a full state management solution rather than a context enhancement
- you can't add peer dependencies like scheduler

## Facets
- artifact type: library
- maturity: active
- function: state-management, frontend-framework
- domain: frontend, web-development, performance
- platform: browser
- tags: react, react-hooks, react-context, context-selector, re-render-optimization, concurrent-react, nodejs

## Member repositories
- dai-shi/use-context-selector (main) score 71

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:32.339136+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-30T07:32:09.256877+00:00, confidence not recorded.
  - readme: https://github.com/dai-shi/use-context-selector (fetched 2026-08-28T04:07:32.339136+00:00, sha 65ceb67f6d55)
  - registry_npm: https://registry.npmjs.org/use-context-selector (fetched 2026-08-29T09:47:41.397905+00:00, sha 962f96ae6619)
- Data as of 2026-08-30T08:39:29.467469+00:00.
