Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte 5: +layout.svelte children not included in zero-effort type safety #2212

Closed
eddiemcconkie opened this issue Nov 23, 2023 · 0 comments
Closed
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@eddiemcconkie
Copy link

eddiemcconkie commented Nov 23, 2023

Describe the bug

The $props for +layout.svelte files should include children, alongside data and form for zero-effort types. You can manually type children as Snippet, but then you have to manually type data and form as well.

Reproduction

<!-- /routes/+layout.svelte -->
<script lang="ts">
  const { children } = $props();
</script>

{@render children()}
<!-- /routes/+page.svelte -->
<h1>Page content</h1>

Expected behaviour

children is included in $props for +layout.svelte files

System Info

  • OS: MacOS
  • IDE: VS Code

Which package is the issue about?

No response

Additional Information, eg. Screenshots

image
@eddiemcconkie eddiemcconkie added the bug Something isn't working label Nov 23, 2023
dummdidumm added a commit that referenced this issue Nov 24, 2023
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Nov 24, 2023
dummdidumm added a commit that referenced this issue Nov 24, 2023
- pass children to zero types Svelte 5: +layout.svelte children not included in zero-effort type safety #2212
- add possibility to pass in version to svelte2tsx to differentiate transpiler targets
- add implicit children prop in Svelte 5 mode Svelte 5: Implicit children not detected correctly #2211
- add best-effort fallback typings to $props() rune
- hide deprecation warnings in generated code Svelte 5: Typescript generics in components are marked as deprecated svelte#9586
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

2 participants