4 ms·
Indeed, also checkout the React.PureComponent for another example of an in-between Class and Function optimisation.
by RoryH 8y ago
Indeed, also checkout the React.PureComponent for another example of an in-between Class and Function optimisation.
- quietbritishjim 8y agoSurprisingly, 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!).