Skip to content

Commit deae88a

Browse files
committed
chore(ssr): Only render children if there are no conditions specified
This was the original intention, but in SSR (Sveltekit), this is not the reality. The route component registers its conditions with the router using $effect.pre(), which doesn't run on the server, causing all routes to be briefly visible.
1 parent 900ad8a commit deae88a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/Route/Route.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,6 @@
169169
});
170170
</script>
171171

172-
{#if (router.routeStatus[key]?.match ?? true)}
172+
{#if (router.routeStatus[key]?.match ?? (!and && !path))}
173173
{@render children?.(params, router.state, router.routeStatus)}
174174
{/if}

0 commit comments

Comments
 (0)