You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some DOM element (here a button), which when clicked should call a callback function (test), which may change depending on a certain state (the variable bool)
#3836 and a few followup PRs added support for dynamic event handler when the compiler can see that the event handler is getting reassigned (e.g,, if the swap() function instead directly assigned either foo or bar to test, this would work), but apparently it's not taking this reactive declaration into account.
I'm in a context similar to the one below:
Some DOM element (here a
button
), which when clicked should call a callback function (test
), which may change depending on a certain state (the variablebool
)When the variable
bool
change, the callback is only updated when writing the directive like this:But if written that way, the callback will keep its first value even if the state change:
I would expect the two declarations to behave in the same way.
Replicate:
https://svelte.dev/repl/ca0fbda83f654f5a8829282a59f511f1?version=3.18.1
The text was updated successfully, but these errors were encountered: