React Performance Anti-Pattern: Creating Functions in render()

React Performance Anti-Pattern: Creating Functions in render()

There is a very common mistake that I see in React components from beginners and experts alike. Sometimes I even find myself typing it, even when I know it’s a mistake. That’s because it feels so right. But if you’re going to write the best React code you can, you need to train yourself to spot this problem and avoid it.

[…]