Make Your React Components Pretty 💅
Mark Brouch
58228

Creating a new callback handler in render is an anti pattern as the child component will have new props in each render. You don’t really leverage the use of stateless functions if you force each component rerender all the time.

I agree that the code looks so much nicer. I would prefer to use SFC if there was a performance gain. But as it’s just a wrapper for a React component you can’t benefit the use of shouldComponentUpdate. And it might come in coming react.

I recommend reading this:

https://medium.com/modus-create-front-end-development/component-rendering-performance-in-react-df859b474adc#.qmyv8b49f

https://medium.com/@esamatti/react-js-pure-render-performance-anti-pattern-fb88c101332f#.nhc67c1oc

A single golf clap? Or a long standing ovation?

By clapping more or less, you can signal to us which stories really stand out.