Shared Data Across Layouts
Load data in a parent layout and access it in child pages and layouts.
Layout Loads
A +layout.js or +layout.server.js can load data shared by all pages under it.
Accessing Data
The page receives data merged from all ancestor layouts and the page itself.
export let data;
// data has both layout and page propertiesAll lessons in this course
- Layout Groups with (group)
- Route-Level Layouts
- Breaking Out of a Layout with +page@route
- Shared Data Across Layouts