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
Check if updating to the latest Preact version resolves the issue
Describe the bug
I'm creating a style object using computed but when it is set on an element, it's not being applied.
If the style is a string signal it works.
functionApp(){constcount=signal(0);constincrement=()=>count.value++;// Style is not working with object styleconststyle=computed(()=>({color: count.value%2 ? "red" : "blue"}));// But it works for stringconststyleString=computed(()=>`color: ${count.value%2 ? "red" : "blue"}`);return(<divstyle={{margin: 20}}><pstyle={style}>{count}</p><pstyle={styleString}>{count}</p><buttononClick={increment}>Increment</button></div>);}
Expected behavior
I would expect style to be updated when signal is used.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm creating a style object using computed but when it is set on an element, it's not being applied.
If the style is a string signal it works.
To Reproduce
A simple code sandbox : https://codesandbox.io/s/preact-style-issue-5nw6q8?file=/src/index.js
Expected behavior
I would expect style to be updated when signal is used.
The text was updated successfully, but these errors were encountered: