You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/kit/src/runtime/app/state/index.js
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,17 @@ import { BROWSER } from 'esm-env';
32
32
* {/if}
33
33
* ```
34
34
*
35
+
* Changes to `page` are available exclusively with runes. (The legacy reactivity syntax will not reflect any changes)
36
+
*
37
+
* ```svelte
38
+
* <!--- file: +page.svelte --->
39
+
* <script>
40
+
* import { page } from '$app/state';
41
+
* const id = $derived(page.params.id); // This will correctly update id for usage on this page
42
+
* $: badId = page.params.id; // Do not use; will never update after initial load
43
+
* </script>
44
+
* ```
45
+
*
35
46
* On the server, values can only be read during rendering (in other words _not_ in e.g. `load` functions). In the browser, the values can be read at any time.
* Changes to `page` are available exclusively with runes. (The legacy reactivity syntax will not reflect any changes)
2360
+
*
2361
+
* ```svelte
2362
+
* <!--- file: +page.svelte --->
2363
+
* <script>
2364
+
* import { page } from '$app/state';
2365
+
* const id = $derived(page.params.id); // This will correctly update id for usage on this page
2366
+
* $: badId = page.params.id; // Do not use; will never update after initial load
2367
+
* </script>
2368
+
* ```
2369
+
*
2359
2370
* On the server, values can only be read during rendering (in other words _not_ in e.g. `load` functions). In the browser, the values can be read at any time.
0 commit comments