DEV Community

Discussion on: React Quick Tip: Use Class Properties and Arrow Functions to Avoid Binding `this` to Methods

tokland profile image
Arnau Sanchez • Edited on

Enrique, I am afraid there really is a performance hit. Not because you are creating an arrow function on the fly - as you say, that's mostly irrelevant-, but because a new function will be passed as a prop and the component will re-render (needlessly).

If this happens with a button, that's not a problem, but more complex components will noticeably slow down your apps. This is a known caveat, you'll find many references in the web (for example: github.com/yannickcr/eslint-plugin...)