-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Description
Describe the bug
If bind:this={ref} is used on an element inside a {#if reactiveState} block, the corresponding let ref declaration gets marked as "non-reactive-update" warning, which I believe is a false positive because the bind reference is still set and updated, and proxying it in $state doesn't change anything—except to remove the linter warning.
Previous issue on a similar topic #10435
Reproduction
https://svelte.dev/playground/ccd2e6f87d7e4985b5834547d4486aae?version=5.25.3
<script>
let showDiv = $state();
let divRef; // Warning: https://svelte.dev/e/non_reactive_update
</script>
{#if showDiv}
<div bind:this={divRef}>Hello</div>
{/if}System Info
Playground, svelte 5.25.3Severity
annoyance
kevlarr
Metadata
Metadata
Assignees
Labels
No labels