Skip to content

This is a compose providers avoid nesting for React Function

License

Notifications You must be signed in to change notification settings

acrool/acrool-react-providers

Repository files navigation

Acrool React Providers

Acrool React Providers Logo

This is a compose providers avoid nesting for React Function

NPM npm npm

npm downloads npm

Features

  • Compose providers avoid nesting
  • Support type check

Install

yarn add @acrool/react-providers

Usage

then in your page

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 & Imagine

About

This is a compose providers avoid nesting for React Function

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published