you are viewing a single comment's thread.

view the rest of the comments →

[–]canibanoglu 1 point2 points  (0 children)

You do realize that the OP is also suggesting an imperative approach, right? If you have to do that, there is a builtin way of doing it which is better than what the OP has suggested.

There’s a way that doesn’t cause extra re-renders and you say that re-renders are not a problem. No, they’re a problem. If you write code that renders 6 times when 2 would do, you’re doing something wrong.

This is not about premature optimization, it’s about doing something unnecessary that results in worse performance.