Skip to content

Commit 9063488

Browse files
sanjaiyan-devslorber
authored andcommitted
feat(core): prefetch on mobile touchstart (#8109)
1 parent 5e072f0 commit 9063488

File tree

1 file changed

+3
-2
lines changed
  • packages/docusaurus/src/client/exports

1 file changed

+3
-2
lines changed

packages/docusaurus/src/client/exports/Link.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function Link(
117117
}
118118
};
119119

120-
const onMouseEnter = () => {
120+
const onInteractionEnter = () => {
121121
if (!preloaded.current && targetLink != null) {
122122
window.docusaurus.preload(targetLink);
123123
preloaded.current = true;
@@ -159,7 +159,8 @@ function Link(
159159
) : (
160160
<LinkComponent
161161
{...props}
162-
onMouseEnter={onMouseEnter}
162+
onMouseEnter={onInteractionEnter}
163+
onTouchStart={onInteractionEnter}
163164
innerRef={handleRef}
164165
to={targetLink}
165166
// Avoid "React does not recognize the `activeClassName` prop on a DOM

0 commit comments

Comments
 (0)