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

On first hover, tooltip is not shown, in React 18

Open gnvcor opened this issue 3 years ago • 3 comments

On first hover, tooltip (with ) is not shown, code example. (react: 18.2.0; react-dom: 18.2.0; react-tooltip: 4.2.21);

Same code example but from react, react-dom: 17.0.2 tooltip is shown on first hover.

gnvcor avatar Jun 28 '22 17:06 gnvcor

For those of you who would prefer to install the package from npm, I've published an npm package based on the 4.2.21 tag on this repository. This tag did not pass the tests so I changed a single line to get the library working again. I hope my package will be obsolete soon and the original npm package will be updated.

@huner2/react-tooltip

This might help you

Lucian2001 avatar Jul 02 '22 11:07 Lucian2001

@gnvcor Why do you conditionally render the ReactTooltip element?

I removed the state logic and it works fine in this example, based on yours.

jdockwarder avatar Jul 14 '22 10:07 jdockwarder

Change this line to true. const [isShowTooltip, setIsShowTooltip] = useState(true);

I guess this is a workaround found under another post, here: https://github.com/ReactTooltip/react-tooltip/issues/758#issuecomment-1119129606

I also mistakenly set the default as false which will disable the ReactTootip component from initializing. The hidden tooltip will not be renderer until you hover on it for the first time.

xzifan avatar Oct 05 '22 14:10 xzifan

Hi, @gnvcor can you try the latest version of the package and let us know, please?

danielbarion avatar Oct 13 '22 21:10 danielbarion

Hi guys, closing due to age, we did some publishes recently, please try the latest one and if necessary, open a new issue, thanks!

danielbarion avatar Nov 09 '22 16:11 danielbarion