fix(react): fixng ion-router-outlet ref regresssion (#21786)

This commit is contained in:
Ely Lucas
2020-07-21 08:48:25 -06:00
committed by GitHub
parent dbe6853884
commit f4a08b7ed4
9 changed files with 72 additions and 5 deletions

View File

@ -46,7 +46,7 @@ class IonRouterOutletContainer extends React.Component<InternalProps, InternalSt
</OutletPageManager>
) : (
<StackManager routeInfo={this.context.routeInfo}>
<IonRouterOutletInner {...props}>
<IonRouterOutletInner {...props} forwardedRef={forwardedRef}>
{children}
</IonRouterOutletInner>
</StackManager>

View File

@ -6,7 +6,10 @@ import { /*@__PURE__*/ createReactComponent } from './createComponent';
export const IonTabButtonInner = /*@__PURE__*/createReactComponent<JSX.IonTabButton & { onIonTabButtonClick?: (e: CustomEvent) => void; }, HTMLIonTabButtonElement>('ion-tab-button');
export const IonTabBarInner = /*@__PURE__*/createReactComponent<JSX.IonTabBar, HTMLIonTabBarElement>('ion-tab-bar');
export const IonBackButtonInner = /*@__PURE__*/createReactComponent<Omit<JSX.IonBackButton, 'icon'>, HTMLIonBackButtonElement>('ion-back-button');
export const IonRouterOutletInner = /*@__PURE__*/createReactComponent<JSX.IonRouterOutlet & { setRef?: (val: HTMLIonRouterOutletElement) => void; }, HTMLIonRouterOutletElement>('ion-router-outlet');
export const IonRouterOutletInner = /*@__PURE__*/createReactComponent<JSX.IonRouterOutlet & {
setRef?: (val: HTMLIonRouterOutletElement) => void;
forwardedRef?: React.RefObject<HTMLIonRouterOutletElement>;
}, HTMLIonRouterOutletElement>('ion-router-outlet');
// ionicons
export const IonIconInner = /*@__PURE__*/createReactComponent<IoniconsJSX.IonIcon, HTMLIonIconElement>('ion-icon');

View File

@ -9,7 +9,7 @@ import { StackContext } from './StackContext';
interface OutletPageManagerProps {
className?: string;
forwardedRef?: React.RefObject<HTMLDivElement>;
forwardedRef?: React.RefObject<HTMLIonRouterOutletElement>;
routeInfo?: RouteInfo;
StackManager: any;
}