How to pass all the slots to <svelte:self>
like ...$$restProps
#12529
-
I am building an interactive markdown renderrer, whose codeblocks are runnable. But it have many alternatives, among which differences only occurs in the CodeBlock and InlineCode components. I want to use named slot to inject these component to the renderrer component, but it seems I don't have a convenient way to pass all the slots as-is to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That is not possible in Svelte 3/4, same for events. In Svelte 5, both event handlers and slots (in the form of snippets) will just be functions passed along other props, so all of them will be forwarded automatically if the props are spread. |
Beta Was this translation helpful? Give feedback.
That is not possible in Svelte 3/4, same for events.
In Svelte 5, both event handlers and slots (in the form of snippets) will just be functions passed along other props, so all of them will be forwarded automatically if the props are spread.