-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse default +layout.js and +layout.server.js in named layout. #6196
Comments
The layout API will very likely change (see discussion), depending on your use case this will be possible introducing groups. If not, you can create a resuable layout UI component and a reusable load function and use that in both your layouts. |
@dummdidumm, thanks for the link! My fault, I skipped it. |
As I can see, only a few people mention about |
#6124 Closes #6196 (using (groups) and/or composition) Closes #5763 (root layout guaranteed to always exist + await parent()) Closes #5311 (+page@.svelte) Closes #4940 (no longer possible to get into this situation) Closes #2154 (only a single root layout now) Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com> Co-authored-by: Dominik G. <dominik.goepel@gmx.de> Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com> Co-authored-by: Conduitry <git@chor.date>
Describe the problem
If I want to have a second root layout, just a different "layout" (
+layout.svelte
) I should copy-paste+layout.js
and+layout.server.js
.In old routing, schema duplicate was only inside
__layout.js
load
function. Even if I moveload
function to a separate file, I will duplicate two extra files for each named layout.Describe the proposed solution
To reduce boilerplate, the named layout should have a way to reuse the default layout client and server functions.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: