angular-architects / module-federation-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use startsWith matcher for react MFE routes

ninjabhishek opened this issue · comments

Hi,

I am using React MFE in Angular shell. matcher: startsWith(...) works well if the MFE is Angular too. What if react MFE has routes and I want to include them all in Angular shell? Tried using matcher but did not work

Hi,

Is your shell Angular and your MFE react?

@manfredsteyer yes. Shell is Angular 14 and MFE is React 17/18 typescript

So let's say the url that should make the shell to route to the react app looks as follows:

/react-mfe1/start

In this case, the Angular shell needs a matcher matching everything starting with /react-mfe1/

And the react app needs to have routes like

/react-mfe1/start
/react-mfe1/further-route
/react-mfe1/etc

Does this work?

Best wishes,
Manfred

No it does not. It does not load any page, not even with '' as path (default page) when router is configured in react app

@manfredsteyer I am using react-router-dom in react app for routing. any suggestions on how to make this work?