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
$$props references 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.
$$restProps contains 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>exportlet attributes;</script>
<element {...attributes} />
Reproduction
N/A
Logs
No response
System Info
-
Severity
annoyance
The text was updated successfully, but these errors were encountered:
Describe the bug
The docs state:
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?Reproduction
N/A
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: