From 03fe3c573db44b84b9834e5a529d96c3712de84b Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 12 Dec 2024 16:45:02 +0100 Subject: [PATCH] Use correct `ownerDocument` when using internal `` (#3594) This PR improves the internal `` component by allowing to pass in a custom `ownerDocument`. This fixes an issue if you do something like this: ```ts import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/react' import { useState } from 'react' import { createPortal } from 'react-dom' export default function App() { let [target, setTarget] = useState(null) return (
) } function MenuExample() { return ( Open Settings Support License ) } ``` --- Here is a little reproduction video. The `` you see is rendered in an `