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 a92e411 commit 4c85658Copy full SHA for 4c85658
src/useLinkProps.ts
@@ -26,9 +26,13 @@ export const useLinkProps = ({
26
}) => {
27
const hrefPath = useMemo(() => parseRoute(href).path, [href]);
28
const getUniversalLocation = useContext(GetUniversalLocationContext);
29
- const getPath = () => hrefPath === getUniversalLocation().raw.path;
30
- const active = useSyncExternalStore(subscribeToLocation, getPath, getPath);
31
+ const getPath = useCallback(
+ () => hrefPath === getUniversalLocation().raw.path,
32
+ [getUniversalLocation, hrefPath],
33
+ );
34
+
35
+ const active = useSyncExternalStore(subscribeToLocation, getPath, getPath);
36
const shouldReplace = replace || active;
37
const shouldIgnoreTarget = target == null || target === "_self";
38
0 commit comments