Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you have example of combination of ApolloClient, React Router and Loadable? #8

Open
veeramarni opened this issue Nov 5, 2023 · 0 comments

Comments

@veeramarni
Copy link

Sould be we go like this?

        const { html: content} = await serverRender.string(() => (
            <ApolloContext.Provider value={{ ...{}, renderPromises }}>
                <ReduxProvider store={store}>
                    <ApolloProvider client={client}>
                        <CacheProvider value={cache}>
                            <StaticRouter location={req.url} context={context}>
                                <GA4Provider>
                                    <MainRoute />
                                </GA4Provider>
                            </StaticRouter>
                        </CacheProvider>
                    </ApolloProvider>
                </ReduxProvider>
                ,
            </ApolloContext.Provider>
        ), {
            outsideEffects: async () => {
                if (renderPromises.hasPromises()) {
                    await renderPromises.consumeAndAwaitPromises();
                  }
            }
        });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant