https://github.com/nixjs/react-nest-providers
A lightweight, type-safe utility for composing multiple React providers into a single, nested tree. Simplify your provider setup with a clean, declarative API that supports optional props and seamless integration with TypeScript. Perfect for managing context providers in large-scale React applications.
https://github.com/nixjs/react-nest-providers
Last synced: 3 months ago
JSON representation
A lightweight, type-safe utility for composing multiple React providers into a single, nested tree. Simplify your provider setup with a clean, declarative API that supports optional props and seamless integration with TypeScript. Perfect for managing context providers in large-scale React applications.
- Host: GitHub
- URL: https://github.com/nixjs/react-nest-providers
- Owner: nixjs
- Created: 2025-03-26T00:42:54.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-26T01:30:16.000Z (3 months ago)
- Last Synced: 2025-03-26T01:35:19.843Z (3 months ago)
- Language: TypeScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @nixjs23n6/react-nest-providers
A lightweight, type-safe utility for composing multiple React providers into a single, nested tree. Simplify your provider setup with a clean, declarative API that supports optional props and seamless integration with TypeScript. Perfect for managing context providers in large-scale React applications.
## Features:
- Effortlessly nest multiple providers with a single function- Full TypeScript support with automatic prop inference
- Flexible API for providers with or without props
- Zero dependencies, minimal footprint
## Install
```shell [npm]
npm install @nixjs23n6/react-nest-providers
``````shell [pnpm]
pnpm add @nixjs23n6/react-nest-providers
``````shell [yarn]
yarn add @nixjs23n6/react-nest-providers
``````shell [bun]
bun add @nixjs23n6/react-nest-providers
```## Example
```typescript
import { buildProvidersTree } from '@nixjs23n6/react-nest-providers';const ProviderTree = buildProvidersTree([
[AuthProvider],
[ThemeProvider, { theme: 'dark' }],
[ValueProvider, { value: 10 }],
]);function App() {
return ;
}
```