Skip to content

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.

Notifications You must be signed in to change notification settings

nixjs/react-nest-providers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

npm install @nixjs23n6/react-nest-providers
pnpm add @nixjs23n6/react-nest-providers
yarn add @nixjs23n6/react-nest-providers
bun add @nixjs23n6/react-nest-providers

Example

import { buildProvidersTree } from '@nixjs23n6/react-nest-providers';

const ProviderTree = buildProvidersTree([
  [AuthProvider],
  [ThemeProvider, { theme: 'dark' }],
  [ValueProvider, { value: 10 }],
]);

function App() {
  return <ProviderTree><YourApp /></ProviderTree>;
}

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published