0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-22 12:27:29 +01:00
svelte/documentation/docs/99-legacy/30-legacy-svelte-component.md
Simon H 4c7cfff434
docs: legacy docs (#13756)
* docs: legacy docs

add docs on old syntax

* rename section

* tweaks

* tweak

* tweaks

* tweaks

* tweaks

* fix link

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-10-21 23:35:51 -04:00

387 B

title
<svelte:component>

In runes mode, <MyComponent> will re-render if the value of MyComponent changes.

In legacy mode, it won't — we must use <svelte:component>, which destroys and recreates the component instance when the value of its this expression changes:

<svelte:component this={MyComponent} />

If this is falsy, no component is rendered.