fix: don't prefetch as links enter viewport

This commit is contained in:
iCrawl
2022-08-26 12:00:25 +02:00
parent 13baf75cae
commit 682e0e1802
9 changed files with 19 additions and 19 deletions

View File

@@ -195,7 +195,7 @@ export function SidebarLayout({
const breadcrumbs = useMemo(
() =>
asPathWithoutQueryAndAnchor.split('/').map((path, idx, original) => (
<Link key={idx} href={original.slice(0, idx + 1).join('/')} passHref>
<Link key={idx} href={original.slice(0, idx + 1).join('/')} passHref prefetch={false}>
<Anchor component="a" sx={(theme) => ({ color: theme.colorScheme === 'dark' ? theme.white : theme.black })}>
{path}
</Anchor>
@@ -317,7 +317,7 @@ export function SidebarLayout({
</MediaQuery>
</Box>
<Group>
<Link href="https://github.com/discordjs/discord.js" passHref>
<Link href="https://github.com/discordjs/discord.js" passHref prefetch={false}>
<ActionIcon
component="a"
target="_blank"
@@ -356,7 +356,7 @@ export function SidebarLayout({
>
<Container>
<Box className={classes.links}>
<Link href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss" passHref>
<Link href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss" prefetch={false}>
<a title="Vercel">
<Image
src="/powered-by-vercel.svg"
@@ -371,12 +371,12 @@ export function SidebarLayout({
<Stack spacing={8}>
<Title order={4}>Community</Title>
<Stack spacing={0}>
<Link href="https://discord.gg/djs" passHref>
<Link href="https://discord.gg/djs" passHref prefetch={false}>
<Anchor component="a" target="_blank" rel="noopener noreferrer" className={classes.link}>
Discord
</Anchor>
</Link>
<Link href="https://github.com/discordjs/discord.js/discussions" passHref>
<Link href="https://github.com/discordjs/discord.js/discussions" passHref prefetch={false}>
<Anchor component="a" target="_blank" rel="noopener noreferrer" className={classes.link}>
GitHub discussions
</Anchor>
@@ -386,17 +386,17 @@ export function SidebarLayout({
<Stack spacing={8}>
<Title order={4}>Project</Title>
<Stack spacing={0}>
<Link href="https://github.com/discordjs/discord.js" passHref>
<Link href="https://github.com/discordjs/discord.js" passHref prefetch={false}>
<Anchor component="a" target="_blank" rel="noopener noreferrer" className={classes.link}>
discord.js
</Anchor>
</Link>
<Link href="https://discordjs.guide" passHref>
<Link href="https://discordjs.guide" passHref prefetch={false}>
<Anchor component="a" target="_blank" rel="noopener noreferrer" className={classes.link}>
discord.js guide
</Anchor>
</Link>
<Link href="https://discord-api-types.dev" passHref>
<Link href="https://discord-api-types.dev" passHref prefetch={false}>
<Anchor component="a" target="_blank" rel="noopener noreferrer" className={classes.link}>
discord-api-types
</Anchor>