Skip to content

Commit

Permalink
fix(bridge-react): add default basename for WraperRouterProvider (#3020)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyuan-new authored Oct 8, 2024
1 parent 9bd1b12 commit 8a77291
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cuddly-pumpkins-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/bridge-react': patch
---

fix(bridge-react): add default basename for WraperRouterProvider
3 changes: 2 additions & 1 deletion packages/bridge/bridge-react/src/router-v6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ function WraperRouterProvider(
return <RouterProvider router={MemeoryRouterInstance} />;
} else {
const BrowserRouterInstance = createBrowserRouter(routers, {
basename: routerContextProps.basename,
// In host app, the routerContextProps is {}, so we should use router.basename as fallback
basename: routerContextProps.basename || router.basename,
future: router.future,
window: router.window,
});
Expand Down

0 comments on commit 8a77291

Please sign in to comment.