Answer the question
In order to leave comments, you need to log in
Why is shouldComponentUpdate called?
There are two components.
In the first I change the state -> in the second, shouldComponentUpdate is called.
Shouldn't this be happening?
Maybe this is due to the use of es6, in one and the other component
constructor(props) {
super(props);
this.state = {
select: false
};
}
Answer the question
In order to leave comments, you need to log in
You didn't provide code, but shouldComponentUpdate is called before the renderer. When you change the state of the parent component, it is re-rendered, which means that all child components also go to the re-render.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question