Skip to content
Break out of provider tree hell.
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
LICENSE
jest.config.js
package.json
prettier.config.js
readme.md
tsconfig.json
yarn.lock

readme.md

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')
);
You can’t perform that action at this time.