Link to page with tabs
Hi!
I've got a page in my ct3a project which has three "tabs" one can open (only one at a time).
By default when opening the page, the first tab is open. However I want to redirect a user to the page with a specific tab open. What'd be the best/standard way to do this?
Something with dynamic routing? Cookies?
7 Replies
query params
/[route]?tab=2
as an exampleAllright, and that would be what Next describes under dynamic routing https://nextjs.org/docs/routing/dynamic-routes ?
Routing: Dynamic Routes | Next.js
Dynamic Routes are pages that allow you to add custom params to your URLs. Start creating Dynamic Routes and learn more here.
no
query param is just a web thing
the [route] was just my placeholder for your route
/?tab=2
/my/deep/nested/page?tab=2
Oh, that's even better. How'd I access that parameter in my .tsx file?
on query you have the query params
Perfect! Thanks a ton