@module-federation/bridge-react
Advanced tools
Comparing version 0.0.0-next-20240619100937 to 0.0.0-next-20240620023927
# @module-federation/bridge-react | ||
## 0.0.0-next-20240619100937 | ||
## 0.0.0-next-20240620023927 | ||
### Patch Changes | ||
- @module-federation/bridge-shared@0.0.0-next-20240619100937 | ||
- @module-federation/bridge-shared@0.0.0-next-20240620023927 |
@@ -29,2 +29,3 @@ "use strict"; | ||
providerInfo, | ||
dispathPopstate, | ||
...resProps | ||
@@ -34,16 +35,18 @@ }) => { | ||
const renderDom = React.useRef(null); | ||
const location = reactRouterDom.useLocation(); | ||
const [pathname, setPathname] = React.useState(location.pathname); | ||
const providerInfoRef = React.useRef(null); | ||
if (dispathPopstate) { | ||
const location = reactRouterDom.useLocation(); | ||
const [pathname, setPathname] = React.useState(location.pathname); | ||
React.useEffect(() => { | ||
if (pathname !== "" && pathname !== location.pathname) { | ||
context.LoggerInstance.log(`createRemoteComponent dispatchPopstateEnv >>>`, { | ||
name, | ||
pathname: location.pathname | ||
}); | ||
context.f(); | ||
} | ||
setPathname(location.pathname); | ||
}, [location]); | ||
} | ||
React.useEffect(() => { | ||
if (pathname !== "" && pathname !== location.pathname) { | ||
context.LoggerInstance.log(`createRemoteComponent dispatchPopstateEnv >>>`, { | ||
name, | ||
pathname: location.pathname | ||
}); | ||
context.f(); | ||
} | ||
setPathname(location.pathname); | ||
}, [location]); | ||
React.useEffect(() => { | ||
const renderTimeout = setTimeout(() => { | ||
@@ -90,3 +93,3 @@ const providerReturn = providerInfo(); | ||
let basename = "/"; | ||
if (routerContextVal.matches[0] && routerContextVal.matches[0].pathnameBase) { | ||
if (routerContextVal && routerContextVal.matches && routerContextVal.matches[0] && routerContextVal.matches[0].pathnameBase) { | ||
basename = routerContextVal.matches[0].pathnameBase; | ||
@@ -100,3 +103,4 @@ } | ||
exportName, | ||
props | ||
props, | ||
routerContextVal | ||
}); | ||
@@ -116,2 +120,3 @@ const m2 = await lazyComponent(); | ||
name: moduleName, | ||
dispathPopstate: (routerContextVal == null ? void 0 : routerContextVal.matches) && (routerContextVal == null ? void 0 : routerContextVal.matches.length) > 0, | ||
...info, | ||
@@ -118,0 +123,0 @@ ...props, |
@@ -11,2 +11,3 @@ import * as React from "react"; | ||
providerInfo, | ||
dispathPopstate, | ||
...resProps | ||
@@ -16,16 +17,18 @@ }) => { | ||
const renderDom = useRef(null); | ||
const location = useLocation(); | ||
const [pathname, setPathname] = useState(location.pathname); | ||
const providerInfoRef = useRef(null); | ||
if (dispathPopstate) { | ||
const location = useLocation(); | ||
const [pathname, setPathname] = useState(location.pathname); | ||
useEffect(() => { | ||
if (pathname !== "" && pathname !== location.pathname) { | ||
LoggerInstance.log(`createRemoteComponent dispatchPopstateEnv >>>`, { | ||
name, | ||
pathname: location.pathname | ||
}); | ||
f(); | ||
} | ||
setPathname(location.pathname); | ||
}, [location]); | ||
} | ||
useEffect(() => { | ||
if (pathname !== "" && pathname !== location.pathname) { | ||
LoggerInstance.log(`createRemoteComponent dispatchPopstateEnv >>>`, { | ||
name, | ||
pathname: location.pathname | ||
}); | ||
f(); | ||
} | ||
setPathname(location.pathname); | ||
}, [location]); | ||
useEffect(() => { | ||
const renderTimeout = setTimeout(() => { | ||
@@ -72,3 +75,3 @@ const providerReturn = providerInfo(); | ||
let basename = "/"; | ||
if (routerContextVal.matches[0] && routerContextVal.matches[0].pathnameBase) { | ||
if (routerContextVal && routerContextVal.matches && routerContextVal.matches[0] && routerContextVal.matches[0].pathnameBase) { | ||
basename = routerContextVal.matches[0].pathnameBase; | ||
@@ -82,3 +85,4 @@ } | ||
exportName, | ||
props | ||
props, | ||
routerContextVal | ||
}); | ||
@@ -98,2 +102,3 @@ const m2 = await lazyComponent(); | ||
name: moduleName, | ||
dispathPopstate: (routerContextVal == null ? void 0 : routerContextVal.matches) && (routerContextVal == null ? void 0 : routerContextVal.matches.length) > 0, | ||
...info, | ||
@@ -100,0 +105,0 @@ ...props, |
{ | ||
"name": "@module-federation/bridge-react", | ||
"version": "0.0.0-next-20240619100937", | ||
"version": "0.0.0-next-20240620023927", | ||
"publishConfig": { | ||
@@ -28,3 +28,3 @@ "access": "public" | ||
"react-error-boundary": "^4.0.13", | ||
"@module-federation/bridge-shared": "0.0.0-next-20240619100937" | ||
"@module-federation/bridge-shared": "0.0.0-next-20240620023927" | ||
}, | ||
@@ -31,0 +31,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
50059
1395
+ Added@module-federation/bridge-shared@0.0.0-next-20240620023927(transitive)
- Removed@module-federation/bridge-shared@0.0.0-next-20240619100937(transitive)
Updated@module-federation/bridge-shared@0.0.0-next-20240620023927