Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to handle reset layout?

I'm now getting this error:

__layout.reset has been removed in favour of named layouts: https://kit.svelte.dev/docs/layouts#named-layouts

I have a sub-directory for which I do not want to inherit the base layout.

$ find . -name '*layout*'               
./setup-profile/__layout.reset.svelte
./auth/__layout.reset.svelte
./__layout.svelte

package.json has

    "@sveltejs/kit": "next",
like image 840
chovy Avatar asked Oct 13 '25 11:10

chovy


1 Answers

The doc page you linked is pretty self-explanatory.

Edit:

Overall the simpler way is to create a named reset layout at the root of your source tree containing a simple <slot />, and reference that layout whenever you want to start from a reset layout:

src/routes/
├ auth/
│ ├ [email protected] (will inherit from the reset layout)
│ ├ pageA.svelte
│ └ pageB.svelte
├ setup-profile/
│ ├ [email protected] (will inherit from the reset layout)
│ ├ pageA.svelte
│ └ pageB.svelte
├ no-reset/
│ ├ __layout.svelte (will inherit from the base layout)
│ ├ pageA.svelte
│ └ pageB.svelte
├ __layout.svelte
└ __layout-reset.svelte
like image 195
Thomas Hennes Avatar answered Oct 15 '25 00:10

Thomas Hennes