refactor: remove extra typescript dependency (#28220)

This commit is contained in:
Liam DeBeasi
2023-09-26 09:01:53 -04:00
committed by GitHub
parent 0b7f6cf573
commit d0d9e35c37
10 changed files with 320 additions and 237 deletions

View File

@ -95,6 +95,7 @@ export const createOverlay = <T extends HTMLIonOverlayElement>(
tagName: string,
opts: object | undefined
): Promise<T> => {
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined') {
return window.customElements.whenDefined(tagName).then(() => {
const element = document.createElement(tagName) as HTMLIonOverlayElement;