Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroborges committed Sep 10, 2024
1 parent f261570 commit 205aaf8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/svelte/src/lib/components/Render.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
</script>

{#if $store.component}
<!-- Add the `key` only to the last (page) component in the tree.
This ensures that the page component re-renders when `preserveState` is disabled,
while the layout components are persisted across page changes. -->
{#key children?.length === 0 ? $store.key : null}
<svelte:component this={component} {...props}>
{#each children as child}
Expand Down

0 comments on commit 205aaf8

Please sign in to comment.