Skip to content

Commit

Permalink
Still show warning with new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Apr 25, 2022
1 parent 4645292 commit 8a695e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/client/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function Link(props: React.PropsWithChildren<LinkProps>) {
// This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes
// eslint-disable-next-line react-hooks/rules-of-hooks
const hasWarned = React.useRef(false)
if (oldBehavior && props.prefetch && !hasWarned.current) {
if (props.prefetch && !hasWarned.current) {
hasWarned.current = true
console.warn(
'Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated'
Expand Down

0 comments on commit 8a695e0

Please sign in to comment.