[🐞] V2: Bug when signal of useComputed$
is used in useTask$
or useVisibleTask$
#7213
Labels
useComputed$
is used in useTask$
or useVisibleTask$
#7213
Which component is affected?
Qwik Runtime
Describe the bug
When a
useComputed$
signal is read inuseVisibleTask$
, the task is executed twice (or multiple times if multipleuseComputed$
are used). Also,useComputed$
is unnecessarily re-executed afterwards.Reproduction
https://stackblitz.com/edit/github-o2f6fj9n-meq2plo7?file=src%2Froutes%2Findex.tsx
Steps to reproduce
Now you should see this in the console:
The expected output would be:
This is because
useComputed$
should only run once on the sever anduseVisibleTask$
should only run once in the browser. A similar bug exists when usinguseTask$
.System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: