themesberg / themesberg/flowbite
Tooltip component performance issues with multiple instances - lazy mounting suggestion
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 9.4k
- Forks
- 862
- PR merge metrics
- No merged PRs in 30d
Description
Description
Describe the bug
The Flowbite Tooltip component causes significant performance issues when multiple instances are used on a page. Each tooltip mounts its content immediately on page load regardless of whether it's visible, causing unnecessary renders and slowing down the application.
To Reproduce
- Create a page with multiple Tooltip components (10+ instances)
- Monitor performance using browser dev tools
- Notice increased load time and reduced responsiveness
- Check React profiler to see all Tooltip contents being mounted simultaneously
Expected behavior
Tooltips should only mount their content when needed (on hover/focus), not on initial page load.
Proposed solution
Implement lazy loading for tooltip content:
- Only mount the tooltip content when the trigger element is hovered/focused
- Unmount content when tooltip is hidden
- Add a prop for preloading if immediate display is required
thanks <3
Contributor guide
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 by locating the Flowbite Tooltip component and reproducing the issue with 10 or more instances while inspecting browser developer tools and the React profiler. Done means tooltip content mounts on hover or focus rather than initial page load, is removed when hidden, and supports the proposed preloading option if immediate display is needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100