deck-context.js
import { useRouter } from "next/navigation";
// ...
const { prefetch } = useRouter();
useEffect(() => {
if (slideIndex < slideCount - 1) {
prefetch(`/presentation/${presentation}/${slideIndex + 1}`)
}
if(slideIndex > 0) {
prefetch(`/presentation/${presentation}/${slideIndex - 1}`)
}
}, [router, presentation, slideCount, slideIndex])
1
Grabbing prefetch from new router
2
Prefetching the route

-