react-tooltip
react-tooltip copied to clipboard
On first hover, tooltip is not shown, in React 18
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.
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.
This might help you
@gnvcor Why do you conditionally render the ReactTooltip element?
I removed the state logic and it works fine in this example, based on yours.
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.
Hi, @gnvcor can you try the latest version of the package and let us know, please?
Hi guys, closing due to age, we did some publishes recently, please try the latest one and if necessary, open a new issue, thanks!