Closed joshwilsonvu closed 2 years ago
Describe the bug Event handlers are a special case in the reactivity rule where it's okay to read reactive variables even though the function isn't tracked by Solid. These are already accounted for in certain places:
reactivity
element.onclick = () => console.log(signal()); <div onClick={() => console.log(signal())} \> <div on:click={() => console.log(signal())} />
But the following warns:
element.addEventListener("click", () => console.log(signal()));
To Reproduce Configure plugin, check last example.
Expected behavior Event handlers added with addEventListener should be treated as called functions.
addEventListener
Describe the bug Event handlers are a special case in the
reactivity
rule where it's okay to read reactive variables even though the function isn't tracked by Solid. These are already accounted for in certain places:But the following warns:
To Reproduce Configure plugin, check last example.
Expected behavior Event handlers added with
addEventListener
should be treated as called functions.