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
I am making an i18n tool using tagged function to embed translative message in a jsx.
I found it doesn't reactively update when the locale has been changed in a condition that the title says.
Here's a simple example that causes this issue.
import{component$,useStore,Signal,useSignal,useTask$}from"@builder.io/qwik";constuseFoo=(counter:Signal<number>)=>{conststate=useStore({});return(s:TemplateStringsArray)=>{constkey=s[0];useTask$(({track})=>{constcount=track(()=>counter.value)state[key]=`${key} - ${count}`})returnstate[key];}}constuseBar=(counter:Signal<number>)=>{conststate=useStore({});return(key:string)=>{useTask$(({track})=>{constcount=track(()=>counter.value)state[key]=`${key} - ${count}`})returnstate[key];}}exportdefaultcomponent$(()=>{constcounter=useSignal(0);constt=useFoo(counter);consts=useBar(counter);return<>
Count up
<div>{t`hello`}</div><div>{t`world`}!</div><buttononClick$={()=>counter.value++}>Click</button><div>{s("hello")}</div><div>{s("world")}!</div></>;});
There are 4 lines that show message with counter value.
I have expected all of them are reactively updated when I click the button.
But the 2nd line does with no luck. This is strange.
genki
changed the title
[🐞] Return value of the tagged function is only reactive if it is alone.
[🐞] Return value of the tagged function is only reactive if it is alone in an element.
Oct 7, 2024
Which component is affected?
Qwik Runtime
Describe the bug
I am making an i18n tool using tagged function to embed translative message in a jsx.
I found it doesn't reactively update when the locale has been changed in a condition that the title says.
Here's a simple example that causes this issue.
There are 4 lines that show message with counter value.
I have expected all of them are reactively updated when I click the button.
But the 2nd line does with no luck. This is strange.
Reproduction
https://qwikdev-build-v2.qwik-8nx.pages.dev/playground/#v=1.9.1&f=7VbLagJBEPyVzeJhRRO8JJAFhSSQL8hNhAm4ICis7Cgiw%2Fy7NV3z8nHw4EHB27LVM91d013dWdF8vn9cKpphHLnDgkOYf9KnKF14h%2FL03UpwQRJg%2Btu2jgZR8aar%2FVDnpJhEcvxeIJI8ju4r44osUafrvwaaBCO%2Bl%2F7quv99vCRcs2z2uERPRzN3uEgjvzIyv212IpzhlBlzwPv69zG%2Foe%2B3Td%2BbS4xTuJjBWvUMvmzxWvSMWFslZpbWPu50xMVjUVSJnm%2Bo4q3ogYeaS1eW4B0mf43uZIFB1ZmzcFONJGfiLmjWWGAwAzVBMHwEBkVjZ%2Fxw21yzTdzCazZq4dpPWS7AR8iu7VZzZV9yiNtxWgrNBQIHAzsROC7T2bW6KsVj2T93CUx8AktO0c6iv0%2F5fTz5PQA
Steps to reproduce
Please visit the link above and click the button to see this issue.
System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: