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
A component author might choose to use rest props as an authoring convenience:
<script>
- let { a, b } = $props();+ let { ...props } = $props();
</script>
-<p>{a} + {b} = {a + b}</p>+<p>{props.a} + {props.b} = {props.a + props.b}</p>
It's not the pattern we promote (you can't specify fallback values or bindability), but it's a valid choice. Right now, this creates a rest_props proxy, even though it's not strictly necessary in this component:
letprops=$.rest_props($$props,[]);
Describe the proposed solution
If the only times props is referenced is in a non-computed member expression, we can skip the rest_props call and treat props.a as though there were a named a prop.
Importance
nice to have
The text was updated successfully, but these errors were encountered:
Describe the problem
A component author might choose to use rest props as an authoring convenience:
It's not the pattern we promote (you can't specify fallback values or bindability), but it's a valid choice. Right now, this creates a
rest_props
proxy, even though it's not strictly necessary in this component:Describe the proposed solution
If the only times
props
is referenced is in a non-computed member expression, we can skip therest_props
call and treatprops.a
as though there were a nameda
prop.Importance
nice to have
The text was updated successfully, but these errors were encountered: