-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Labels
Description
Describe the bug
The docs state:
$$propsreferences all props that are passed to a component, including ones that are not declared with export. It is not generally recommended, as it is difficult for Svelte to optimise.
$$restPropscontains only the props which are not declared with export. It can be used to pass down other unknown attributes to an element in a component. It shares the same optimisation problems as$$props, and is likewise not recommended.
What exactly does that mean?
What are the consequences to expect?
Does the type of usage matter, e.g. $$props.something in JS vs <element {...$$props} />?
For $$restProps, would it be better to collect additional data in a single property when used in a spread?
<element {...$$restProps} />
vs
<script>export let attributes;</script>
<element {...attributes} />Reproduction
N/A
Logs
No response
System Info
-Severity
annoyance
nikmolnar, grind-t, Serator, thenbe, Syed-Sheharyar and 5 moreSyed-Sheharyar, eric1iu and 8ctopotamus