Next.js Discord

Discord Forum

Get current route as folder structure

Unanswered
Southern yellowjacket posted this in #help-forum
Open in Discord
Southern yellowjacketOP
I'm currently migrating from pages to app router. For a tracking component we have a switch with some routes, based on the route there's different tracking. With the previous pages router it was possible to use const {route} = useRouter() to get the route like /[locale]/[[...slug]]. I don't seem to find a way to get the same result.

0 Replies