File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
apps/router-demo/router-host-2000/src
packages/bridge/bridge-react/src/remote Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/bridge-react ' : patch
3
+ ---
4
+
5
+ feat: support basename passed by remote module props
Original file line number Diff line number Diff line change @@ -127,7 +127,9 @@ const App = () => {
127
127
< Route path = "/detail/*" Component = { Detail } />
128
128
< Route
129
129
path = "/remote1/*"
130
- Component = { ( ) => < Remote1App name = { 'Ming' } age = { 12 } ref = { ref } /> }
130
+ Component = { ( ) => (
131
+ < Remote1App name = { 'Ming' } age = { 122 } basename = "/remote1" />
132
+ ) }
131
133
/>
132
134
< Route
133
135
path = "/remote2/*"
Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ export function withRouterData<
158
158
WrappedComponent : React . ComponentType < P & ExtraDataProps > ,
159
159
) : React . FC < Omit < P , keyof ExtraDataProps > > {
160
160
const Component = forwardRef ( function ( props : any , ref ) {
161
+ if ( props ?. basename ) {
162
+ return (
163
+ < WrappedComponent { ...props } basename = { props . basename } ref = { ref } />
164
+ ) ;
165
+ }
161
166
let enableDispathPopstate = false ;
162
167
let routerContextVal : any ;
163
168
try {
You can’t perform that action at this time.
0 commit comments