@nixjs23n6/react-nest-providers
Version:
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 cont
49 lines (32 loc) • 1.14 kB
Markdown
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.
- 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
```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
```
```typescript
import { buildProvidersTree } from '@nixjs23n6/react-nest-providers';
const ProviderTree = buildProvidersTree([
[],
[],
[],
]);
function App() {
return <ProviderTree><YourApp /></ProviderTree>;
}
```