You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Component.svelte -->
<script>
let {action, state} =$props()
</script>
<!-- ERROR: $$props.action is not a function -->
<divuse:action={state}></div>
if we define function action(){} inside the component, it works.
$.action(div,($$node,$$props)=>$$props.action($$node,$$props),()=>$$props.state);// ^conflict ^intends to reference component props
dangelomedinag
changed the title
Svelte 5: $$props.action is not a function when passing an action as prop
Svelte 5: Argument name conflict in generated code
Feb 28, 2024
Describe the bug
if we define
function action(){}
inside the component, it works.Reproduction
link
Logs
$$props.action is not a function
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: