Skip to content

Commit 50b4bc0

Browse files
committed
note breaking props.children change
1 parent 313c71a commit 50b4bc0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sites/svelte-5-preview/src/routes/docs/content/01-api/03-snippets.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ Any content inside the component tags that is _not_ a snippet declaration implic
215215
</table>
216216
```
217217

218+
> Note that you cannot have a prop called `children` if you also have content inside the component — for this reason, you should avoid having props with that name
219+
218220
## Snippets and slots
219221

220222
In Svelte 4, content can be passed to components using [slots](https://svelte.dev/docs/special-elements#slot). Snippets are more powerful and flexible, and as such slots are deprecated in Svelte 5.

sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ Svelte now use Mutation Observers intead of IFrames to measure dimensions for `b
5454
- The `tag` option was removed. Use `<svelte:options customElement="tag-name" />` inside the component instead
5555
- The `loopGuardTimeout`, `format`, `sveltePath`, `errorMode` and `varsReport` options were removed
5656

57+
## The `children` prop is reserved
58+
59+
Content inside component tags becomes a [snippet prop](/docs/snippets) called `children`. You cannot have a separate prop by that name.
60+
5761
## Other breaking changes
5862

5963
### Stricter `@const` assignment validation

0 commit comments

Comments
 (0)