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
Copy file name to clipboardExpand all lines: apps/svelte.dev/content/tutorial/01-svelte/03-props/03-spread-props/index.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Spread props
3
3
---
4
4
5
-
In this exercise, we've forgotten to pass the `name` prop expected by `PackageInfo.svelte`, meaning the `<code>` element is empty and the npm link is broken.
5
+
In this exercise, in `App.svelte`we've forgotten to pass the `name` prop expected by `PackageInfo.svelte`, meaning the `<code>` element is empty and the npm link is broken.
6
6
7
7
We _could_ fix it by adding the prop...
8
8
@@ -23,7 +23,7 @@ We _could_ fix it by adding the prop...
23
23
<PackageInfo +++{...pkg}+++ />
24
24
```
25
25
26
-
> [!NOTE] Conversely, you can get an object containing all the props that were passed into a component using a rest property...
26
+
> [!NOTE] Conversely, in `PackageInfo.svelte`you can get an object containing all the props that were passed into a component using a rest property...
27
27
>
28
28
> ```js
29
29
>let { name, ...stuff } =$props();
@@ -34,3 +34,9 @@ We _could_ fix it by adding the prop...
34
34
> ```js
35
35
>let stuff =$props();
36
36
>```
37
+
>
38
+
> ...in which case you can access the properties by their object paths:
0 commit comments