fix(react): adding swipe back functionality and routerOutlet ready improvements, fixes #19818 (#19849)

This commit is contained in:
Ely Lucas
2019-11-06 10:08:57 -07:00
committed by Ely Lucas
parent 2f5d823748
commit f3ac682010
7 changed files with 124 additions and 86 deletions

View File

@ -24,7 +24,7 @@ export { IonBackButton } from './navigation/IonBackButton';
export { IonRouterOutlet } from './IonRouterOutlet';
// Utils
export { isPlatform, getPlatforms } from './utils';
export { isPlatform, getPlatforms, getConfig } from './utils';
export { RouterDirection } from './hrefprops';
// Icons that are used by internal components

View File

@ -1,4 +1,4 @@
import { Platforms, getPlatforms as getPlatformsCore, isPlatform as isPlatformCore } from '@ionic/core';
import { Platforms, getPlatforms as getPlatformsCore, isPlatform as isPlatformCore, Config as CoreConfig } from '@ionic/core';
import React from 'react';
import { IonicReactProps } from '../IonicReactProps';
@ -24,3 +24,13 @@ export const isPlatform = (platform: Platforms) => {
export const getPlatforms = () => {
return getPlatformsCore(window);
};
export const getConfig = (): CoreConfig | null => {
if (typeof (window as any) !== 'undefined') {
const Ionic = (window as any).Ionic;
if (Ionic && Ionic.config) {
return Ionic.config;
}
}
return null;
};