We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ec471c commit 820f3e7Copy full SHA for 820f3e7
documentation/docs/20-core-concepts/20-load.md
@@ -120,8 +120,8 @@ Data returned from layout `load` functions is available to child `+layout.svelte
120
121
+++ // we can access `data.posts` because it's returned from
122
// the parent layout `load` function
123
- $: index = data.posts.findIndex(post => post.slug === $page.params.slug);
124
- $: next = data.posts[index - 1];+++
+ let index = $derived(data.posts.findIndex(post => post.slug === $page.params.slug));
+ let next = $derived(data.posts[index - 1];)+++
125
</script>
126
127
<h1>{data.post.title}</h1>
0 commit comments