DEV Community

Beaver Bridge
Beaver Bridge

Posted on • Updated on

Sveltekit layout.svelte not call when page moved

페이지가 이동하면 +layout.svelte도 다시 읽어오게 해야하는데, layout.server.js, layout.js, layout.svelte가 호출되지 않는다.

옆자리 직원의 도움을 받아보니

export const load = async ({ locals, url, params }) => {
  const { pathname } = url;
  ...
}
Enter fullscreen mode Exit fullscreen mode

이렇게 +layout.server.js 의 load 에서 url을 받아와야 layout.js, layout.svelte도 호출됐다.

Top comments (0)