-
I'm wondering, what benefits does this provide over just wrapping the page component with layout directly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
A component might not have a layout defined, so there's a fallback to an identity function ( |
Beta Was this translation helpful? Give feedback.
-
Well seems we don't have docs on this, but we should. The reason is to achieve persisted layouts. Layouts which just wrap each page directly will be unmounted on each page transition. See more explanation here: https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/ |
Beta Was this translation helpful? Give feedback.
Well seems we don't have docs on this, but we should.
The reason is to achieve persisted layouts. Layouts which just wrap each page directly will be unmounted on each page transition.
See more explanation here: https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/