Next.js Discord

Discord Forum

how to detect router navigation in Next13 app directory?

Answered
definitelynotshourya posted this in #help-forum
Open in Discord
I want to detect routeChangeStart and routeChangeEnd in the next 13 router.

How to do this?
Answered by joulev
routeChangeEnd: https://nextjs.org/docs/app/api-reference/functions/use-router#router-events

routeChangeStart: listen to onClick event of next/link
View full answer

2 Replies