mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
feat(core): prefetch on mobile touchstart (#8109)
This commit is contained in:
parent
029893fea2
commit
f7c3af9102
|
|
@ -117,7 +117,7 @@ function Link(
|
|||
}
|
||||
};
|
||||
|
||||
const onMouseEnter = () => {
|
||||
const onInteractionEnter = () => {
|
||||
if (!preloaded.current && targetLink != null) {
|
||||
window.docusaurus.preload(targetLink);
|
||||
preloaded.current = true;
|
||||
|
|
@ -159,7 +159,8 @@ function Link(
|
|||
) : (
|
||||
<LinkComponent
|
||||
{...props}
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseEnter={onInteractionEnter}
|
||||
onTouchStart={onInteractionEnter}
|
||||
innerRef={handleRef}
|
||||
to={targetLink}
|
||||
// Avoid "React does not recognize the `activeClassName` prop on a DOM
|
||||
|
|
|
|||
Loading…
Reference in New Issue