Skip to content

Commit 820f3e7

Browse files
committed
docs: update for svelte 5
1 parent 8ec471c commit 820f3e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

documentation/docs/20-core-concepts/20-load.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ Data returned from layout `load` functions is available to child `+layout.svelte
120120
121121
+++ // we can access `data.posts` because it's returned from
122122
// the parent layout `load` function
123-
$: index = data.posts.findIndex(post => post.slug === $page.params.slug);
124-
$: next = data.posts[index - 1];+++
123+
let index = $derived(data.posts.findIndex(post => post.slug === $page.params.slug));
124+
let next = $derived(data.posts[index - 1];)+++
125125
</script>
126126
127127
<h1>{data.post.title}</h1>

0 commit comments

Comments
 (0)