react-provider-tree
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

React Provider Tree

Break out of provider tree hell.

Install

$ yarn add react-provider-tree

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import { createProviderTreeFromList } from 'react-provider-tree';
import { App } from './App';
import { ProviderA } from './providers/ProviderA';
import { ProviderB } from './providers/ProviderB';
import { ProviderC } from './providers/ProviderC';
 
const ProviderTree = createProviderTreeFromList(
  [ProviderA, { value: 'foo' }],
  [ProviderB, { value: 'bar' }],
  [ProviderC, { value: 'baz' }]
);
 
ReactDOM.render(
  <ProviderTree>
    <App />
  </ProviderTree>,
  document.getElementById('root')
);

Dependents (0)

Package Sidebar

Install

npm i react-provider-tree

Weekly Downloads

0

Version

0.1.3

License

none

Unpacked Size

4.67 kB

Total Files

7

Last publish

Collaborators

  • joshmanders