From 47dc73784bd84a4b14d01804c8fdc745d809cddf Mon Sep 17 00:00:00 2001 From: Oleg Lustenko Date: Thu, 27 Jun 2024 12:11:34 +0300 Subject: [PATCH] fix: allow "null" to Link prefetch type We have some components that set `prefetch=true.` However, in some specific cases, we want to enable "soft-prefetch". To enable soft prefetch, we want to pass "null" In the same way as it default value here https://github.com/vercel/next.js/blob/canary/packages/next/src/client/link.tsx#L279 Thoughts about this change? --- packages/next/src/client/link.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/client/link.tsx b/packages/next/src/client/link.tsx index 1c3b149d8b615..d8d062012245d 100644 --- a/packages/next/src/client/link.tsx +++ b/packages/next/src/client/link.tsx @@ -75,7 +75,7 @@ type InternalLinkProps = { * * @defaultValue `true` */ - prefetch?: boolean + prefetch?: boolean | null /** * The active locale is automatically prepended. `locale` allows for providing a different locale. * When `false` `href` has to include the locale as the default behavior is disabled.