#TIL disable Next.JS prefetching when you point to route.js

Published on 2023-06-09 · Next.js Today I Learned

You have to disable prefetching in <Link> component, when you point to the route created by route.js or route.ts.

I learned it (almost) hard way — you have to disable prefetching1 in <Link> component, when you point to the route created by route.js or route.ts.

If you won’t disable prefetching, you can delete your content, if the route is coded to do so.

Footnotes

  1. <Link> prefetch documentation