headlessui
headlessui copied to clipboard
React Popover v2: warnings when used inside `p`-element
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
2.1.0
What browser are you using?
Chrome
Reproduction URL
See the sandbox
Describe your issue
When using Popover
nested inside a p
-element, the following warning is logged in the console:
Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.
As you can see in the sandbox, all of the popover components use as="span"
, but there is an empty div
rendered within the Popover
causing this issue:
Is this empty div
-element critical for the popover to work, or is there a way to opt out from this element?