Skip to content

Commit 47890e0

Browse files
authored
docs: explain that +layout files do not affect +server.js (#13152)
closes #12401
1 parent f121323 commit 47890e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

documentation/docs/20-core-concepts/10-routing.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Pages can receive data from `load` functions via the `data` prop.
5353
> [!LEGACY]
5454
> In Svelte 4, you'd use `export let data` instead
5555
56-
> [!NOTE] Note that SvelteKit uses `<a>` elements to navigate between routes, rather than a framework-specific `<Link>` component.
56+
> [!NOTE] SvelteKit uses `<a>` elements to navigate between routes, rather than a framework-specific `<Link>` component.
5757
5858
### +page.js
5959

@@ -302,6 +302,8 @@ If an error is thrown (either `error(...)` or an unexpected error), the response
302302
303303
> [!NOTE] When creating an `OPTIONS` handler, note that Vite will inject `Access-Control-Allow-Origin` and `Access-Control-Allow-Methods` headers — these will not be present in production unless you add them.
304304
305+
> [!NOTE] `+layout` files have no effect on `+server.js` files. If you want to run some logic before each request, add it to the server [`handle`](hooks#Server-hooks-handle) hook.
306+
305307
### Receiving data
306308
307309
By exporting `POST`/`PUT`/`PATCH`/`DELETE`/`OPTIONS`/`HEAD` handlers, `+server.js` files can be used to create a complete API:

0 commit comments

Comments
 (0)