Skip to content

Commit 11fb311

Browse files
committed
docs: move migration dot notation component initialization notes to svelte:component section
1 parent f5954fa commit 11fb311

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

documentation/docs/07-misc/07-v5-migration-guide.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,16 @@ This is no longer true in Svelte 5:
660660
```
661661
While migrating, keep in mind that your user-defined component's name should be capitalized (`Thing`) to distinguish it from a normal HTML element and avoid incorrect types.
662662

663+
### Dot notation indicates a component
664+
665+
In Svelte 4, `<foo.bar>` would create an element with a tag name of `"foo.bar"`. In Svelte 5, `foo.bar` is treated as a component instead. This is particularly useful inside `each` blocks:
666+
667+
```svelte
668+
{#each items as item}
669+
<item.component {...item.props} />
670+
{/each}
671+
```
672+
663673
## Whitespace handling changed
664674

665675
Previously, Svelte employed a very complicated algorithm to determine if whitespace should be kept or not. Svelte 5 simplifies this which makes it easier to reason about as a developer. The rules are:
@@ -693,16 +703,6 @@ The `legacy` compiler option, which generated bulkier but IE-friendly code, no l
693703

694704
Content inside component tags becomes a snippet prop called `children`. You cannot have a separate prop by that name.
695705

696-
## Dot notation indicates a component
697-
698-
In Svelte 4, `<foo.bar>` would create an element with a tag name of `"foo.bar"`. In Svelte 5, `foo.bar` is treated as a component instead. This is particularly useful inside `each` blocks:
699-
700-
```svelte
701-
{#each items as item}
702-
<item.component {...item.props} />
703-
{/each}
704-
```
705-
706706
## Breaking changes in runes mode
707707

708708
Some breaking changes only apply once your component is in runes mode.

0 commit comments

Comments
 (0)