Replies: 1 comment 1 reply
-
|
Did you find any solution? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using react-query with vite-plugin-federation.
In main app, I config like this
Appcomponent of main app will import the remote app.At remote
Appcomponent, I use react-query, but at this moment, it will raise errorNo QueryClient set, use QueryClientProvider to set one.Is there a way to share the context with remote
Appcomponent? I tried to research in the document and couldn't find a solution. Or maybe I missed something from document.Currently, I add
QueryClientProviderinsideAppcomponent of remote app. But if I do it, when run the remote app alone, there is aQueryClientProvidernested insideQueryClientProviderdue to themain.tsxof remote app is config like the main app.To solve this problem, I duplicate
Appcomponent, one to serve formodule federationand one for running app alone.But even I duplicate the
Appcomponent, when running full app (main app and import the remote app via module federation), there will be aQueryClientProvidernested inQueryClientProvider, I still not know if there is any issue if we do that or not. But I guess if I wanna get the cached data from remote app in main app, I cannot do that. If we can share the context, I think no problem with that use case 🤔Beta Was this translation helpful? Give feedback.
All reactions