# dai-shi/use-context-selector

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/dai-shi-use-context-selector).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

2,953 stars · 62 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/dai-shi/use-context-selector
- Homepage: https://www.npmjs.com/package/use-context-selector
- awesome-repositories: https://awesome-repositories.com/repository/dai-shi-use-context-selector.md

## Topics

`custom-hook` `react` `react-context` `react-hooks`

## Description

Use context selector is a state management library that allows applications to share state across component trees without prop drilling or unnecessary re-renders. It provides a specialized React context creation mechanism alongside hooks for reading targeted context slices, ensuring that components update only when their specific data changes.

The library features granular dependency tracking and selector-based subscriptions to prevent sluggish rendering caused by broad state updates. It also includes cross-root context bridging to connect isolated component trees under a single provider and wraps state modification functions to maintain synchronization during concurrent rendering cycles.

## Tags

### Web Development

- [React State Management](https://awesome-repositories.com/f/web-development/react-state-management.md) — Manages shared application state across component trees using React context without prop drilling.
- [React Hooks](https://awesome-repositories.com/f/web-development/frontend-development-tools/frontend-frameworks/component-authoring/react-ecosystem/react-hooks.md) — Provides a React hook for reading specific context slices and re-rendering components when targeted data changes.
- [State Management Libraries](https://awesome-repositories.com/f/web-development/frontend-development-tools/frontend-frameworks/component-authoring/react-ecosystem/react-libraries/state-management-libraries.md) — Shares application state across component trees without prop drilling or unnecessary re-renders.
- [Context Memoization](https://awesome-repositories.com/f/web-development/performance-optimizations/component-update-optimizations/context-memoization.md) — Prevents sluggish component rendering by selecting only specific data slices needed from context.
- [Dependency Tracking](https://awesome-repositories.com/f/web-development/performance-optimizations/component-update-optimizations/dependency-tracking.md) — Tracks individual selector results during render phases to prevent unnecessary re-renders when unrelated state changes.
- [Cross-Root Context Distribution](https://awesome-repositories.com/f/web-development/instance-management/root-initializations/root-accessors/root-state-distribution/cross-root-context-distribution.md) — Shares context data across isolated React root trees by wrapping them in a specialized provider component. ([source](https://github.com/dai-shi/use-context-selector#readme))

### Data & Databases

- [State Slice Subscriptions](https://awesome-repositories.com/f/data-databases/set-to-slice-exports/state-slice-subscriptions.md) — Extracts specific portions of shared state within consuming components so they update only on targeted changes. ([source](https://github.com/dai-shi/use-context-selector#readme))
- [Application State Management](https://awesome-repositories.com/f/data-databases/application-state-management.md) — Shares application state across component trees by wrapping parts of the application in a provider. ([source](https://github.com/dai-shi/use-context-selector/tree/main/src))

### Software Engineering & Architecture

- [Context Subscriptions](https://awesome-repositories.com/f/software-engineering-architecture/event-subscribers/context-subscriptions.md) — Subscribes components to fine-grained state slices via selector functions to update only when targeted data changes.
- [Component Context Sharing](https://awesome-repositories.com/f/software-engineering-architecture/shared-state-management/component-context-sharing.md) — Establishes specialized state containers for hierarchical sharing across component trees. ([source](https://github.com/dai-shi/use-context-selector/blob/main/README.md))
- [State Containers](https://awesome-repositories.com/f/software-engineering-architecture/architectural-design-patterns/state-management/centralized-state-containers/state-containers.md) — Retrieves complete state values from shared containers to provide consistent consumption across component trees. ([source](https://github.com/dai-shi/use-context-selector/blob/main/README.md))
- [Concurrent Rendering Architectures](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-rendering-architectures.md) — Wraps state updates to ensure safe synchronization during concurrent rendering cycles in the user interface.
- [Concurrent Update Wrappers](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-state-management/concurrent-update-wrappers.md) — Wraps state modification functions to maintain synchronization during concurrent rendering cycles. ([source](https://github.com/dai-shi/use-context-selector/blob/main/README.md))

### User Interface & Experience

- [Selective Re-rendering](https://awesome-repositories.com/f/user-interface-experience/selective-re-rendering.md) — Subscribes components to specific slices of context data, updating only when targeted data changes. ([source](https://github.com/dai-shi/use-context-selector/blob/main/.prettierignore))
- [Cross-Root Bridges](https://awesome-repositories.com/f/user-interface-experience/component-tree-isolation/cross-root-bridges.md) — Bridges isolated component trees under a single provider to allow seamless data sharing across boundaries.
