react-component / react-component/tooltip
Tooltip triggers reflow & redraw too much times at any tooltip prop update
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 944
- Forks
- 199
- Avg merge
- 19h 1m
- Merged PRs (30d)
- 3
Description
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.

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Content.js at the componentDidUpdate method and trace when trigger.forcePopupAlign() runs during tooltip prop updates. Compare the current behavior with the suggested lifecycle change, then verify that alignment still occurs when needed without repeated reflow and redraw during ordinary updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100