Next.js Discord

Discord Forum

Pre-loading routes

Answered
Rex posted this in #help-forum
Open in Discord
RexOP
Hi, I found that when I click on a button which redirects me to another page (router.push('/...')) it requires so much time for the first time the user click, after this it works fast.
Any suggestions?
Answered by not-milo.tsx
You can use the prefetch method attached to the router.

See: https://nextjs.org/docs/app/api-reference/functions/use-router#userouter
View full answer

2 Replies