-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
Is your feature request related to a problem? Please describe.
At the moment, there is no way to manage component events for a dynamic component, with spread props. Let consider this example:
<script>
const props = {
'label': 'Click me'
'on:action': () => {}
}
</script>
<svelte:component this={Comp} {...props} />
on:action
will not be called.
Describe the solution you'd like
To have the code above working 😊
Describe alternatives you've considered
The workaround is to consider callbacks instead of events, like this :
<script>
const props = {
'label': 'Click me'
'onAction': () => {}
}
</script>
<svelte:component this={Comp} {...props} />
But then the code in Comp must be different compared to a normal dispatch usage.
How important is this feature to you?
It's just annoying because the workaround works pretty well, but maybe it can be a useful feature to keep consistency with the spread props.
TheComputerM, TylerRick, LeanderG, armchair-traveller, ihym and 46 more
Metadata
Metadata
Assignees
Labels
No labels