mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(react): properly check for custom elements to avoid errors in unit tests (#24156)
resolves #24149
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user