#How to use some common layout between pages.

4 messages · Page 1 of 1 (latest)

plush crown
#

This seems like a fairly small problem but I am unable to find a proper solution. I have a company directory and a [name].tsx dynamic route. How do i make some elements (header, navbar) persist between all routes following /company/
I do have a layout.tsx with common elements but how do i render the dynamic pages inside a specific container within the layout component

frail nymph
#

I think you may be overcomplicating this, but in this situation I would simply create a new layout even if it's close to a copy/paste of the other and slot your body where you want.

elfin lodge
#

Layout.tsx works only in app dir and applies to the route where the file is located in, and sub-routes

#

If you're in the pages directory, use _app.tsx