Files
headlessui/packages/@headlessui-react/src/hooks/use-owner.ts
T
Robin Malfait c219d87a69 Use ownerDocument instead of document (#1158)
* use `ownerDocument` instead of `document`

This should ensure that in iframes and new windows the correct document
is being used.

* update changelog
2022-03-10 13:37:50 +01:00

7 lines
227 B
TypeScript

import { useMemo } from 'react'
import { getOwnerDocument } from '../utils/owner'
export function useOwnerDocument(...args: Parameters<typeof getOwnerDocument>) {
return useMemo(() => getOwnerDocument(...args), [...args])
}