Closed mareklibra closed 5 years ago
@mareklibra isn't there better way to ask for rerender ? forceUpdate will skip shouldComponentUpdate
which is not good IMO
@mareklibra isn't there better way to ask for rerender ? forceUpdate will skip shouldComponentUpdate which is not good IMO
Originally, I was thinking about using setState
and letting shouldComponentUpdate
decide. But the code seemed to me equal as it effectively by-passed any additional logic in the shouldComponentUpdate
and could be reduced to this one.
The shouldComponentUpdate
would return false
unless throttling allows otherwise. And if we want guarantee to start the renderer, no matter if future props changes will come, this is equal. If this is not requested and we can rely on future props changes to "fire" the lifecycle, we can make the go "nicer" and get rid of the forceUpdate
.
Right, in case it is used in wrong scenario (not our case). That will be resolved by the setState. I'll revert so everybody is happy :-).
@cloudbehl @gnehapk FYI to improve your dashboard performance, i'd suggest to use LazyRenderer
Avoids eager re-rendering for frequent redux store changes.
Assumption: re-render requests are frequent, so skipping a few of them has no impact on rendered information from user's perspective.
If that assumption is not met, the use of this component is not recommended.