mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
chore(): sync with main
This commit is contained in:
@ -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);
|
||||
|
4
packages/react/src/utils/HTMLElementSSR.ts
Normal file
4
packages/react/src/utils/HTMLElementSSR.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export const HTMLElementSSR = (
|
||||
typeof HTMLElement !== 'undefined'
|
||||
? HTMLElement
|
||||
: class {}) as typeof HTMLElement;
|
Reference in New Issue
Block a user