A

Admin • 828.03K Points
Coach

Q. What is the difference between React.Component and React.PureComponent?

  • (A) PureComponent implements shouldComponentUpdate with a shallow prop and state comparison
  • (B) Component is only for functional components
  • (C) PureComponent cannot have state
  • (D) Component automatically memoizes
  • Correct Answer - Option(A)
  • Views: 13
  • Filed under category React JS
  • Hashtags:

Explanation by: Admin
PureComponent avoids re-renders if props/state do not change shallowly.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.