Pure Functions
- Same input -> Same output. Returns the same output when the same input(props) is provided to the function.
- No changes are made to any objects or variables that were created before the function was called.
Pure Components
React.Component - Have to manually add shouldComponentUpdate
Reat.PureComponent - Internally calls shouldComponentUpdate
Pure component helps to improve performance.
Top comments (0)