Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Indeed, also checkout the React.PureComponent for another example of an in-between Class and Function optimisation.


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!).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: