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

No style on tooltip when rendered in React Fragment

Open mawilmouth opened this issue 5 years ago • 2 comments

When rendering a tooltip next to the target element in a React Fragment, the tooltip is not styled. Upon hovering, the tooltip does appear but does not have any styles applied to it. When I wrapped them in a div, it worked fine. I understand that this may not be a huge issue but I do think that a Fragment wrapper should be handled.

This does not work

<React.Fragment>
   <div
     data-tip
     data-for="githubTest"
     data-testid="ownershipIconContainer"
   >
        <p>hover me</p>
   </div>
   <ReactTooltip
     type="dark"
     effect="solid"
     place="top"
     id="githubTest"
   >
        <p data-testid="ownershipTipText">{ownershipText}</p>
   </ReactTooltip>
</React.Fragment>

This works

<div>
   <div
     data-tip
     data-for="githubTest"
     data-testid="ownershipIconContainer"
   >
        <p>hover me</p>
   </div>
   <ReactTooltip
     type="dark"
     effect="solid"
     place="top"
     id="githubTest"
   >
        <p data-testid="ownershipTipText">{ownershipText}</p>
   </ReactTooltip>
</div>

mawilmouth avatar Nov 16 '20 16:11 mawilmouth

Same issue here too

lordvcs avatar Feb 15 '22 06:02 lordvcs

https://github.com/wwayne/react-tooltip/issues/610#issuecomment-654349371 this solved the issue for me <ReactTooltip uuid="" />

lordvcs avatar Feb 15 '22 06:02 lordvcs