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
In a <svelte:component> like the following, where a prop value is the result of a function call and both the function as well as the component constructor are contained in a common parent object, the function call is executed twice each time the constructor changes:
Looking at the generated code, it appears that the component's p() method computes the values for switch_instance_changes without checking if it's actually required -- if the constructor (switch_value) changes, switch_instance_changes will never be used, but fn() will be called again in switch_props() instead:
Describe the bug
In a
<svelte:component>
like the following, where a prop value is the result of a function call and both the function as well as the component constructor are contained in a common parent object, the function call is executed twice each time the constructor changes:Looking at the generated code, it appears that the component's
p()
method computes the values forswitch_instance_changes
without checking if it's actually required -- if the constructor (switch_value
) changes,switch_instance_changes
will never be used, butfn()
will be called again inswitch_props()
instead:Reproduction
https://svelte.dev/repl/b00cabd142d64ab9b872ec69dbe9b0bb?version=3.42.1
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: