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
- Host: GitHub
- URL: https://github.com/acrool/acrool-react-providers
- Owner: acrool
- License: mit
- Created: 2024-07-31T11:51:10.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-12-20T02:39:22.000Z (5 months ago)
- Last Synced: 2025-04-13T01:08:21.384Z (about 1 month ago)
- Language: TypeScript
- Size: 362 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-react - Acrool React Providers - React Providers Compose (ex: Multi provider) (React underlying structure)
- awesome-react - Acrool React Providers - React Providers Compose (ex: Multi provider) (React underlying structure)
README
# Acrool React Providers
This is a compose providers avoid nesting for React Function[](https://www.npmjs.com/package/@acrool/react-providers)
[](https://github.com/acrool/@acrool/react-providers/blob/main/LICENSE)
[](https://github.com/acrool/react-providers/blob/main/LICENSE)[](https://www.npmjs.com/package/@acrool/react-providers)
[](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)