# another-multi-provider

> React Multi Provider - Clean up deeply nested provider components!

Latest version **1.0.0** (published 2020-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install another-multi-provider
pnpm add another-multi-provider
yarn add another-multi-provider
bun add another-multi-provider
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-02-09 |
| First published | 2020-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | pzs |
| Maintainers | pzs |

## Links

- npm: https://www.npmjs.com/package/another-multi-provider
- Repository: https://github.com/pzs/another-multi-provider
- Issues: https://github.com/pzs/another-multi-provider/issues
- npm.io page: https://npm.io/package/another-multi-provider

## Recent versions

- 1.0.0 (latest) — 2020-02-09

## README

# Another React Multi Provider

> Clean up your deeply nested provider components!


## Example

Transform your code from something that looks like this:

```jsx
<AuthenticationProvider configuration={configuration}>
  <MuiPickersUtilsProvider utils={DateFnsUtils}>
    <ThemeProvider theme={theme}>
      <DialogProvider>
        <AnotherContextProvider>
          <Router>
            <App />
          </Router>
        </AnotherContextProvider>
      </DialogProvider>
    </ThemeProvider>
  </MuiPickersUtilsProvider>
</AuthenticationProvider>
```

to this:

```jsx
<MultiProvider providers={[
  [AuthenticationProvider, { configuration }],
  [MuiPickersUtilsProvider, { utils: DateFnsUtils }],
  [ThemeProvider, { theme }],
  DialogProvider,
  AnotherContextProvider,
  Router,
]}>
  <App />
</MultiProvider>
```

## Installation

```bash
npm install --save another-multi-provider
```

## Usage

```jsx
import MultiProvider from 'another-multi-provider';

<MultiProvider providers={[
  // providers...
]}>
  <App />
</MultiProvider>
```

## Inspired by

- Article: https://kamranicus.com/posts/2018-07-07-react-nesting-components-flat

- Similar library: https://www.npmjs.com/package/react-multi-provider
    - However with this library you can get warnings like this: `Warning: Failed prop type: The prop 'children' is marked as required in 'MuiPickersUtilsProvider', but its value is 'undifined'.`

## License

[MIT](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/another-multi-provider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
