react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

Re-rendering unnecessarily?

Open Ganasist opened this issue 6 years ago • 2 comments

I've been optimising across my app recently using "why-did-you-update"

It's triggering on react-tooltip quite a bit:

screen shot 2018-01-24 at 13 47 11

Is there any way you could optimise this via PureComponent or shouldComponentUpdate?

Ganasist avatar Jan 24 '18 12:01 Ganasist

i got the same problem, render performance is very slow especially in IE11 - probably because of react-tooltip, because it is the only component that shows up with why-did-you-update.

ateufel avatar Feb 14 '18 09:02 ateufel

Personally, I would advise against using this library in any React app. Visually, it looks really good and slick....but It's reliance on dom-attribute-scraping severely breaks some key react precepts and hence leads to the various performance issues present.

As it stands, it is an admirable, yet naive approach at implementing a Tooltip system in React. Akin more to a JQuery way of achieving the same.

To the Author, best way to properly achieve something like this in React is to give your users a <Tooltip text="...">...</Tooltip> component to wrap their hoverables with. That Tooltip component can then build itself as needed and can smoothly satisfy dynamic rendering needs as well.

iyobo avatar Jun 08 '22 02:06 iyobo