Skip to content

Commit 3ef6f14

Browse files
pleek91claude
andcommitted
Drop a navigation guard that never fired
It compared a copy of a parameter against the parameter it was copied from, so the condition was never true. Its job — keeping a superseded navigation from acting on its own props — is done by the ABANDONED response instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent e8a0954 commit 3ef6f14

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/services/createRouter.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function createRouter<
165165
}
166166

167167
if (!isExternal(url)) {
168-
setPropsAndUpdateRoute(navigationId, to, from)
168+
setPropsAndUpdateRoute(to, from)
169169
}
170170

171171
const afterResponse = await hooks.runAfterRouteHooks({ to, from })
@@ -192,15 +192,9 @@ export function createRouter<
192192
history.startListening()
193193
}
194194

195-
function setPropsAndUpdateRoute(navigationId: string, to: ResolvedRoute, from: ResolvedRoute | null): void {
196-
const currentNavigationId = navigationId
197-
195+
function setPropsAndUpdateRoute(to: ResolvedRoute, from: ResolvedRoute | null): void {
198196
propStore.setProps(to)
199197
.then((response) => {
200-
if (currentNavigationId !== navigationId) {
201-
return
202-
}
203-
204198
switch (response.status) {
205199
case 'SUCCESS':
206200
case 'ABANDONED':

0 commit comments

Comments
 (0)