tooltip
tooltip copied to clipboard
Tooltip triggers reflow & redraw too much times at any tooltip prop update
The problem located in Content.js
file at lines:
componentDidUpdate() {
const { trigger } = this.props;
if (trigger) {
trigger.forcePopupAlign();
}
}
On every re-render/changing props it invokes forcePopupAlign
. Using tooltip inside heavy and complex application with dozen nested component leads to freezing the page.
My suggestion is to implement more smarter calling of forcePopupAlign
. For the most cases (except very dynamic ones) it is more than enough to move the logic out from componentDidUpdate
to componentDidMount
.
I'm getting really slow performance when showing and hiding lots of tooltips (like 30 of them). But this proposed code change doesn't help.