This is a compose providers avoid nesting for React Function
- Compose providers avoid nesting
- Support type check
yarn add @acrool/react-providers
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))
);