Jul 2, 2019 in React JS
Q: what is shouldComponentUpdate method?

1 Answer

0 votes
Jul 2, 2019

Determines if the component will be updated or not. By default it returns true. If you are sure that the component doesn't need to render after state or props are updated, you can return false value. It is a great place to improve performance as it allows you to prevent a re-render if component receives new prop.

Related questions

0 votes
Jul 2, 2019 in React JS
0 votes
Jun 19, 2020 in React JS
...