React Pure Components

FatimaAlam1234 - Apr 23 - - Dev Community

Pure Functions

  1. Same input -> Same output. Returns the same output when the same input(props) is provided to the function.
  2. 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.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .