Next.js Discord

Discord Forum

Next 13 (App dir) : How to accept other props apart from "children"

Answered
Gull-billed Tern posted this in #help-forum
Open in Discord
Gull-billed TernOP
I'm currently working with NextJS 13 app directory and I created a layout but the content in the pages that use the layout will be different, How do I pass props?
Answered by DirtyCajunRice | AppDir
probably better to make the text a client component and usePathname() or get your session in it
View full answer

6 Replies

layout isnt meant to pass props
Gull-billed TernOP
ohh
you can use multiple nested layouts or sibling layouts based on route tho
Gull-billed TernOP
It's a auth layout, just need to change some text
probably better to make the text a client component and usePathname() or get your session in it
Answer
Gull-billed TernOP
I'll use the "usePathname" hook, thanks!