score:2

In Svelte, useRef() is bind:this.

<script>
  let inputEl;
  let handleClick = () => inputEl.focus()
</script>

<input bind:this={inputEl}/>
<button on:click={handleClick}>Focus</button>

You could find more React hooks examples in Svelte from this repository


Related Query

More Query from same tag