1

I've been trying to have a React app using Vite acting as a microfrontend in an Angular shell / host using Native Federation (also tried using Module Federation). After some time searching, I managed to find examples on GitHub like this one:manfredsteyer/mf-nf-poc (the React microfrontend doesn't seem to be using Vite, but still).

I also foundmanfredsteyer/native-federation-react-example. However, beside this being "React remote and React host" (it also works when used in an Angular host), once I addreact-router-dom and switch to using the router withcreateBrowserRouter(), everything falls apart and the apps simply don't load. There's errors claiming thatTypeError: c.createContext is not a function.

bootstrap.tsx:

<React.StrictMode>  <RouterProvider router={router} /></React.StrictMode>

My question is: is it possible to do routing usingreact-router-dom in a microfrontend that is hosted in Angular? And also is it possible to do routing in a React host either? I am interested in learning both, but neither seem to work as per my attempts and there's just 0 resources out there that show React microfrontend routing.

Before I forget, I did try using nearly any npm package out there related to Native Federation as well as Module Federation and all the resources lack proper examples with React routing.

askedApr 25 at 8:28
JrDeveloper's user avatar

0

Know someone who can answer? Share a link to thisquestion viaemail,Twitter, orFacebook.

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.