fix(react): properly check for custom elements to avoid errors in unit tests (#24156)

resolves #24149
This commit is contained in:
Anant Sharma
2021-12-07 03:36:17 +05:30
committed by GitHub
parent f6a00ea954
commit 8f188eaae7

View File

@ -16,9 +16,9 @@ class IonTabsElement extends HTMLElementSSR {
} }
if (typeof (window as any) !== 'undefined' && window.customElements) { if (typeof (window as any) !== 'undefined' && window.customElements) {
const element = customElements.get('ion-tabs'); const element = window.customElements.get('ion-tabs');
if (!element) { if (!element) {
customElements.define('ion-tabs', IonTabsElement); window.customElements.define('ion-tabs', IonTabsElement);
} }
} }