You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Been working on a micro frontend and wondering how you can (if possible) do data fetching for micro frontends.
The basics of the route fetching works fine with in the micro frontend provider for a route (/routes/page.tsx, /routes/page.data.tsx) and for a component using useRouteLoaderData. However as soon as you expose either the page or the component to the application that hosts the micro frontend it gets:
useLoaderData must be used within a data router.
I want the component to render based on the data it fetches because I don't want the host to have to worry about it. I realize I could just use a useEffect/setState render system but I was hoping for S2S data fetch and that would not allow that.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
Been working on a micro frontend and wondering how you can (if possible) do data fetching for micro frontends.
The basics of the route fetching works fine with in the micro frontend provider for a route (/routes/page.tsx, /routes/page.data.tsx) and for a component using
useRouteLoaderData
. However as soon as you expose either the page or the component to the application that hosts the micro frontend it gets:useLoaderData must be used within a data router.
I want the component to render based on the data it fetches because I don't want the host to have to worry about it. I realize I could just use a
useEffect/setState
render system but I was hoping for S2S data fetch and that would not allow that.Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions