Answer the question
In order to leave comments, you need to log in
How to stop Render when new props are received?
Can't figure out componentWillReceiveProps still renders.
And I need to catch the condition so as not to call render
Answer the question
In order to leave comments, you need to log in
You need to use the method
of i.e. your case
shouldComponentUpdate(nextProps, nextState) {
if (this.props.a != nextProps.a) {
return false
} else {
return true
}
}
shouldComponentUpdate(nextProps) {
return this.props.a !== nextProps.a;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question