Lightspeed Interview Question

How to optimise a component in ReactJS?