We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e442f97 commit 8a31a3bCopy full SHA for 8a31a3b
src/utils/get-container.ts
@@ -1,7 +1,11 @@
1
+export type GetContainer = () => HTMLElement
2
+
3
export function resolveContainer(
- getContainer: HTMLElement | (() => HTMLElement) | undefined | null
4
+ getContainer: HTMLElement | GetContainer | undefined | null
5
) {
6
const container =
- typeof getContainer === 'function' ? getContainer() : getContainer
7
+ typeof getContainer === 'function'
8
+ ? (getContainer as GetContainer)()
9
+ : getContainer
10
return container || document.body
11
}
0 commit comments