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.
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.