docs: Move note on runes mode that ended up in wrong section. (#12876)

pull/12880/head
brunnerh 3 months ago committed by GitHub
parent 6448e07521
commit 686b0865c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -82,6 +82,8 @@ When authoring custom elements, use the new [host rune](/docs/runes#$host) to di
>greet</button> >greet</button>
``` ```
Note that using `$props` and `$host` will put you in [runes mode](/docs/runes) — be sure to update your props and state accordingly.
## `<svelte:component>` in runes mode ## `<svelte:component>` in runes mode
In previous versions of Svelte, the component constructor was fixed when the component was rendered. In other words, if you wanted `<X>` to re-render when `X` changed, you would either have to use `<svelte:component this={X}>` or put the component inside a `{#key X}...{/key}` block. In previous versions of Svelte, the component constructor was fixed when the component was rendered. In other words, if you wanted `<X>` to re-render when `X` changed, you would either have to use `<svelte:component this={X}>` or put the component inside a `{#key X}...{/key}` block.
@ -112,8 +114,6 @@ A derived value may be used in other contexts:
+ <Component /> + <Component />
``` ```
Note that using `$props` and `$host` will put you in [runes mode](/docs/runes) — be sure to update your props and state accordingly.
## `immutable` ## `immutable`
The `immutable` compiler option is deprecated. Use runes mode instead, where all state is immutable (which means that assigning to `object.property` won't cause updates for anything that is observing `object` itself, or a different property of it). The `immutable` compiler option is deprecated. Use runes mode instead, where all state is immutable (which means that assigning to `object.property` won't cause updates for anything that is observing `object` itself, or a different property of it).

Loading…
Cancel
Save