preact-devtools
preact-devtools copied to clipboard
Updates to text nodes caused by signal changes are not hightlighted
Demo:
const s = signal(0);
function inc() {
s.value++;
}
export default function App() {
return html`
${s}
<button onclick=${inc}>Increment</button>
`;
}
When "Highlight updates" is enabled, I would expect the number to be highlighted every time it changes because I click on the button.
https://user-images.githubusercontent.com/7000710/225608523-08a31b8f-98ff-45ad-8d58-4d8b9fe1669e.mov
I don't think it should... since your using the templated value {inc} this is an optimized mechanism that doesn't re-render the component. Change it to {inc.value} and you will see it update, as this DOES cause the re-render 👍🏻
The component is not re-rendered, but the text node is.