[FEAT REQ] Easier way to attach tooltips to dynamically generated elements
See original GitHub issueIn v4, I was able to create a single <ReactTooltip />
somewhere on my application, and use the data-for
prop to share that same tooltip across all text elements (for example) in a table. Since it doesn’t seem to be any obvious way to do this in v5, I’m left with using wrapper components that generate an id (#836 is quite relevant here) for my anchor element, alongside the <Tooltip />
element.
I’m not sure if there is another way to do this aside from the data-*
method, but it would definitely be very helpful, since that was a very convenient feature in v4. Anyway, I’ll understand if this is something the package is trying to shy away from completely in v5.
Another alternative that would make things easier, would be to go the @mui/material
route, and be able to use the tooltip as a wrapper to the anchor element, but I’m not sure how viable that would be for the v5 architecture.
Issue Analytics
- State:
- Created 9 months ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Btw, sorry for spamming a bit with opening issues. Started using the package a few days ago in my project, but almost dropped since I ran into a bug that was a deal-breaker.
Came here today looking for some guidance in the docs, and saw that v5 was released. Tried it out, and the bug was no more, so I decided to keep using it.
Aside from this and the other issues I’ve opened, v5 is working fine, so keep up the great work.
https://react-tooltip.com/docs/examples/multiple-anchors