Skip to content

Remove optional chaining in layout's render children #752

@hyunbinseo

Description

@hyunbinseo

The +layout.svelte's children prop seems to be typed as Snippet?

I remember it being Snippet | undefined but seems to have changed.

If so, this is now possible:

- {@render children?.()}
+ {@render children()}

This change will match the code with the docs:

<script lang="ts">
  import type { LayoutProps } from './$types';

  let { data, children }: LayoutProps = $props();
</script>

<main>
  <!-- +page.svelte is `@render`ed here -->
  {@render children()}
</main>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions