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
App
component of main app will import the remote app.At remote
App
component, 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
App
component? I tried to research in the document and couldn't find a solution. Or maybe I missed something from document.Currently, I add
QueryClientProvider
insideApp
component of remote app. But if I do it, when run the remote app alone, there is aQueryClientProvider
nested insideQueryClientProvider
due to themain.tsx
of remote app is config like the main app.To solve this problem, I duplicate
App
component, one to serve formodule federation
and one for running app alone.But even I duplicate the
App
component, when running full app (main app and import the remote app via module federation), there will be aQueryClientProvider
nested 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