Rayli Raykov
Rayli Raykov

Reputation: 31

__layout.reset has been removed in favour of named layouts

I have a page set up in this format

original reset image

I looked at forums and it said i should change the inner layout page to [email protected]. However when i do that, I get another error.

reset image using @reset instead of .reset
Does anyone know how i can put in a reset __layout inside of a folder and get it to override the parent layout?

Upvotes: 0

Views: 1210

Answers (3)

jugurtha moad
jugurtha moad

Reputation: 414

Layouts can themselves choose to inherit from named layouts

  1. create "__layout-root.svelte" at the same level as index.svelte and about.svelte with the following code <slot/>
  2. create "[email protected]" in guides folder with the following <slot></slot>

Upvotes: 0

jugurtha moad
jugurtha moad

Reputation: 414

I think that you can solve this problem by fallowing this steps :

  1. Create "__layout-choseNameYouWant.svelte" at the same level as "__layout.svelte"
  2. Create "[email protected]" at the same level as about.svelte

Upvotes: 0

Josh
Josh

Reputation: 51

Your error is because [email protected] would be looking for a __layout-reset.svelte file in it's current directory, or any parent directory directory, to be a sub-layout for. You don't have a __layout-reset.svelte file.

As Thomas Hennes mentioned in the other thread. If you wanted to have it act like the reset, you'd need to create a __layout-reset.svelte file in the current folder or (more useful for the entire app, in the root folder) and have it be a blank <slot />. From there, you can do [email protected] to which will allow you to make a completely new layout.

Upvotes: 0

Related Questions