An open API service indexing awesome lists of open source software.

https://github.com/acrool/acrool-react-providers

This is a compose providers avoid nesting for React Function
https://github.com/acrool/acrool-react-providers

Last synced: about 1 month ago
JSON representation

This is a compose providers avoid nesting for React Function

Awesome Lists containing this project

README

        

# Acrool React Providers


Acrool React Providers Logo


This is a compose providers avoid nesting for React Function

[![NPM](https://img.shields.io/npm/v/@acrool/react-providers.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-providers)
[![npm](https://img.shields.io/bundlejs/size/@acrool/react-providers?style=for-the-badge)](https://github.com/acrool/@acrool/react-providers/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/l/@acrool/react-providers?style=for-the-badge)](https://github.com/acrool/react-providers/blob/main/LICENSE)

[![npm downloads](https://img.shields.io/npm/dm/@acrool/react-providers.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-providers)
[![npm](https://img.shields.io/npm/dt/@acrool/react-providers.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-providers)

## Features

- Compose providers avoid nesting
- Support type check

## Install

```bash
yarn add @acrool/react-providers
```

## Usage

then in your page

```tsx
import composedProviders, {providerWithProps} from "@acrool/react-providers";

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
createElement(composedProviders(
[
providerWithProps(ReduxProvider, {store}),
providerWithProps(ApolloProvider, {client: apolloClient}),
providerWithProps(ReactQueryClientProvider, {}),
providerWithProps(ReactLocaleProvider, {}),
providerWithProps(Router, {history: history, basename: routePrefixPath}),
providerWithProps(AxiosClientProvider, {}),
providerWithProps(StyleSheetManager, {stylisPlugins: [rtlPlugin]}),
providerWithProps(GridThemeProvider, {gridTheme: gridConfig}),
providerWithProps(ThemeProvider, {theme: appTheme}),
providerWithProps(UIProvider, {}),
]
)(App))
);

```

## License

MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)