You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/documentation/docs/99-legacy/30-legacy-svelte-component.md

14 lines
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
<svelte:component this={MyComponent} />
```
If `this` is falsy, no component is rendered.