3 ms·
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
by Tade0 7y ago
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.