← React Beginner Questions - Set 9 Q86
What is the purpose of the shouldComponentUpdate lifecycle method?
React Beginner Questions - Set 9
Example
1
2
3
shouldComponentUpdate(nextProps, nextState) {
return nextProps.value !== this.props.value; // false = skip render
}
What to notice
- Returning `false` skips the subtree too — an escape hatch, and a common source of stale UI.
← Back to the question list