DEV Community

Earth's Resident
Earth's Resident

Posted on

How do I make a specific child page not trigger the load of data from +layout.server.js from the parent page in Sveltekit?

I have a Sveltekit project with the below folder structure in src/routes:

+layout.server.js
+page.svelte
    child_1/
        +page.svelte
    child_2/
        +page.svelte
Enter fullscreen mode Exit fullscreen mode

The website should load the data from +layout.server.js when it is on the root page or child_1 but not when it is on child_2.

How do I make this happen?

Thanks in advance for any advice.

Top comments (0)