Next.js Discord

Discord Forum

How to get the pagename

Answered
Havana posted this in #help-forum
Open in Discord
HavanaOP
how can I get the page name from the layout.tsx that was generated with Metadata inside a dynamic route

5 Replies

@Havana how can I get the page name from the `layout.tsx` that was generated with Metadata inside a dynamic route
you can convert the layout.tsx to a client component and use usePathname
Answer
wait check this to get dynamic route parameters
HavanaOP
good thing I mentioned the dynamic route