Which method in a react component should you override to stop the component from updating?
Tuesday, March 29, 2022
Add Comment
Question: Which method in a react component should you override to stop the component from updating?
You should override shouldComponentUpdate method in react component to prevent component from updating. Because the shouldComponentUpdate method allows us to break out of the complex react update lifecycle to avoid calling it repeatedly on every re-render.
0 Komentar
Post a Comment