We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f52ff8 commit 710f5ccCopy full SHA for 710f5cc
packages/react-router/src/Transitioner.tsx
@@ -56,6 +56,16 @@ export function Transitioner() {
56
const nextPublicHref = trimPathRight(nextLocation.publicHref)
57
58
if (latestPublicHref !== nextPublicHref) {
59
+ const latestOrigin = new URL(router.latestLocation.url).origin
60
+ const nextOrigin = new URL(nextLocation.url).origin
61
+
62
+ if (latestOrigin !== nextOrigin) {
63
+ if (typeof window !== 'undefined') {
64
+ window.location.href = nextLocation.url
65
+ }
66
+ return
67
68
69
router.commitLocation({ ...nextLocation, replace: true })
70
}
71
0 commit comments