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/test/runtime/samples/binding-this-element-reacti.../main.svelte

10 lines
165 B

<script>
export let visible = true;
let h1;
</script>
<div>The text is {h1 ? h1.textContent : 'missing'}</div>
{#if visible}
<h1 bind:this={h1}>hello</h1>
{/if}