Skip to content

Commit

Permalink
disable prefetching on dev for links
Browse files Browse the repository at this point in the history
  • Loading branch information
feedthejim committed Dec 5, 2022
1 parent b653942 commit c432a8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/next/client/link.tsx
Expand Up @@ -522,6 +522,11 @@ const Link = React.forwardRef<HTMLAnchorElement, LinkPropsReal>(

// Prefetch the URL if we haven't already and it's visible.
React.useEffect(() => {
// in dev, we only prefetch on hover to avoid wasting resources
if (process.env.NODE_ENV !== 'production') {
return
}

if (!router) {
return
}
Expand Down

0 comments on commit c432a8b

Please sign in to comment.