'children' is of type 'unknown'.js(18046) #11379
Unanswered
Theonlyhamstertoh
asked this question in
Q&A
Replies: 2 comments 2 replies
-
I am unfamiliar with Typescript but in the documentation, there is an explanation about typing the props :
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you can do this now <script lang="ts">
import type { Snippet } from 'svelte'
let { children } = $props<{ children: Snippet }>()
</script>
<button>{@render children()}</button> |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I am trying to play around with Svelte 5. I am trying to replace
slot
with@render children()
instead but it throwing me the type error'children' is of type 'unknown'.js(18046)
. What can I do in typescript to fix this?Dependencies
Beta Was this translation helpful? Give feedback.
All reactions