When a component extends ________, it automatically implements shouldComponentUpdate with a shallow comparison of state and props.

  • Component
  • PureComponent
  • React.Component
  • React.PureComponent
When a component extends React.PureComponent, it automatically implements shouldComponentUpdate with a shallow comparison of state and props. This shallow comparison helps in optimizing rendering by preventing unnecessary updates when there are no actual changes to state or props.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *