Skip to content

Commit 9db966c

Browse files
committed
better fix for active hash hydration mismatch
1 parent 98c2f06 commit 9db966c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/react-router/src/link.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ export function useLinkProps<
261261
}
262262

263263
// Hash is not available on the server
264+
if (activeOptions?.includeHash) {
265+
return false
266+
}
267+
264268
return true
265269
})()
266270

@@ -504,8 +508,8 @@ export function useLinkProps<
504508
}
505509
}
506510

507-
if (isHydrated && activeOptions?.includeHash) {
508-
return s.location.hash === next.hash
511+
if (activeOptions?.includeHash) {
512+
return isHydrated && s.location.hash === next.hash
509513
}
510514
return true
511515
},

0 commit comments

Comments
 (0)