This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-20).
Problem
The onNavigate callback prop on <Link> (added in Next.js 15) does not fire. Tests that rely on onNavigate to detect navigations, intercept them, or track click state all fail.
Specific failures include:
onNavigate callback never fires on click
Click state tracking broken (link thinks it was never clicked)
History state replacement via onNavigate return value not working
Reproduce first in vinext's own test suite. Add a test with <Link href="/page" onNavigate={(e) => ...}> and verify the callback fires on click. Confirm it does not.
Study the Next.js implementation. Search .nextjs-ref/packages/next/src/client/link.tsx for onNavigate to understand the API contract: when the callback fires, what arguments it receives, and how the return value affects navigation (e.g., preventing default, replacing history state).
Implement onNavigate in the next/link shim. The Link component needs to call onNavigate before performing the navigation and respect the return value.