Closed gorhawk closed 5 years ago
If you mean a DOM change by rendering, you are right. But the default implementation of shouldComponentUpdate just returns true. That means the lifecycle methods get called and eventually (most likely) React decides there should be no DOM change. You can help out React by not calling setState with the same state.
Yeah, found it in the docs: https://reactjs.org/docs/react-component.html#setstate
Sorry, I should've provided a description.
Edit: Oh, and it seems the React docs should also be updated too. In v16, you can return null from a setState callback. That's what I did in this commit. https://reactjs.org/blog/2017/09/26/react-v16.0.html
Oh, you're talking about the life cycle methods.
Will merge it. Thanks for contribution.
Yes, including render :D
Hi, why do we need this? If
resizing
is false before, there shouldn't be any re-rendering, right?