I'm building a component in StencilJS which has a tooltip.
I would like to append this tooltip's markup in the document.body instead of my component, as it runs into issues when the component is wrapped in an element with overflow:hidden (the tooltip gets cut off)
Is there any way to achieve this?
I have the exact same component in React, and I managed to fix it by using ReactDOM.createPortal(tooltip, document.body)
but I can't seem to be able to find a similar solution in Stencil (plus, the documentation is quite basic).
I also tried manually generating the elements with document.createElement
but it's a pain and too verbose, and I have a couple of icons as components I would like to include.
An alternative solution would be a way to transform JSX into actual markup I can then use by doing document.body.append(tooltip)
.