-
Does Solid only update the affected DOM nodes when for example an array of strings is rendered into a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
They aren't handled differently. It's one of the reasons to use state vs signals. There is only shallow diffing anywhere in the DOM handling side of things. For simple changes on nodes we are talking primitive values, strings numbers etc.. So there isn't really much concern here on updates here. But for nested values it gets trickier. If you use a signal to hold an array of objects and only want to update one property on it, well you are going to do wasted work. You are going to blow out the whole row. State is better here. If you are talking about an array of strings though, it doesn't really matter which way you go. And in the term of list handling you probably want to use |
Beta Was this translation helpful? Give feedback.
They aren't handled differently. It's one of the reasons to use state vs signals. There is only shallow diffing anywhere in the DOM handling side of things. For simple changes on nodes we are talking primitive values, strings numbers etc.. So there isn't really much concern here on updates here. But for nested values it gets trickier. If you use a signal to hold an array of objects and only want to update one property on it, well you are going to do wasted work. You are going to blow out the whole row. State is better here.
If you are talking about an array of strings though, it doesn't really matter which way you go. And in the term of list handling you probably want to use
<Index>
to ke…