News for hackers. Stuff that matters.
Re:When does React re-render? Explaining rerenders and how t... by Tade0 on Wednesday April 29, 2020 @07:54AM (#23018050)
I see that oftentimes this stems from the lack of knowledge regarding how the system underneath (VDOM, DOM, JS VM, computer ) works.

Case in point: why are (or were?) anonymous functions frowned upon in React props?

Is it because of the penalty involved with creating a function on each render call? Of course not - my phone can do 19mln of those a second.

It's because the VDOM sees a reference change, so it re-renders the component.

Obviously if there's a performance penalty, it's because of the latter, but I heard the former before as an argument in a discussion.

There are no comments on this comment yet.