Hacker News new | ask | show | jobs
by RoryH 2758 days ago
Indeed, also checkout the React.PureComponent for another example of an in-between Class and Function optimisation.
1 comments

Surprisingly, pure functional components are called even when their props haven't changed so PureComponent is not "in between" but "even more" than functional components. As for regular components, you can override this behaviour by adding a componentWillReceiveProps() method (yes, you can add a method to your functional component!).