fix(react): add SSR check to IonTabs (#23696)

resolves #23651
This commit is contained in:
William Martin
2021-08-02 10:28:51 -04:00
committed by GitHub
parent caf0917623
commit f2a05bed1e
2 changed files with 7 additions and 2 deletions

View File

@ -3,18 +3,19 @@ import React, { Fragment } from 'react';
import { NavContext } from '../../contexts/NavContext';
import PageManager from '../../routing/PageManager';
import { HTMLElementSSR } from '../../utils/HTMLElementSSR';
import { IonRouterOutlet } from '../IonRouterOutlet';
import { IonTabBar } from './IonTabBar';
import { IonTabsContext, IonTabsContextState } from './IonTabsContext';
class IonTabsElement extends HTMLElement {
class IonTabsElement extends HTMLElementSSR {
constructor() {
super();
}
}
if (window && window.customElements) {
if (typeof (window as any) !== 'undefined' && window.customElements) {
const element = customElements.get('ion-tabs');
if (!element) {
customElements.define('ion-tabs', IonTabsElement);