Skip to content

Commit f4b37a8

Browse files
committed
Navigation API removal
1 parent be1a09f commit f4b37a8

14 files changed

+1
-1914
lines changed

docs/docs/components/navigator.md

-233
This file was deleted.

src/android/ReactXP.ts

-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import { default as LinkImpl, Link as LinkType } from '../native-common/Link';
3131
import { default as LinkingImpl, Linking as LinkingType } from '../native-common/Linking';
3232
import { default as LocationImpl, Location as LocationType } from '../common/Location';
3333
import { default as ModalImpl, Modal as ModalType } from '../native-common/Modal';
34-
import { default as NavigatorImpl, Navigator as NavigatorType } from '../native-common/Navigator';
3534
import { default as NetworkImpl, Network as NetworkType } from '../native-common/Network';
3635
import { default as PlatformImpl, Platform as PlatformType } from '../native-common/Platform';
3736
import { default as PopupImpl, Popup as PopupType } from '../native-common/Popup';
@@ -98,8 +97,6 @@ module ReactXP {
9897
export var Location = LocationImpl;
9998
export type Modal = ModalType;
10099
export var Modal = ModalImpl;
101-
export type Navigator = NavigatorType;
102-
export var Navigator = NavigatorImpl;
103100
export type Network = NetworkType;
104101
export var Network = NetworkImpl;
105102
export type Platform = PlatformType;

src/common/Interfaces.ts

-12
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,6 @@ export interface LocationConfiguration {
206206
skipPermissionRequests: boolean;
207207
}
208208

209-
export abstract class Navigator extends React.Component<Types.NavigatorProps, any> {
210-
abstract push(route: Types.NavigatorRoute): void;
211-
abstract pop(): void;
212-
abstract replace(route: Types.NavigatorRoute): void;
213-
abstract replacePrevious(route: Types.NavigatorRoute): void;
214-
abstract replaceAtIndex(route: Types.NavigatorRoute, index: number): void;
215-
abstract immediatelyResetRouteStack(nextRouteStack: Types.NavigatorRoute[]): void;
216-
abstract popToRoute(route: Types.NavigatorRoute): void;
217-
abstract popToTop(): void;
218-
abstract getCurrentRoutes(): Types.NavigatorRoute[];
219-
}
220-
221209
export abstract class Network {
222210
abstract isConnected(): SyncTasks.Promise<boolean>;
223211
connectivityChangedEvent = new SubscribableEvent<(isConnected: boolean) => void>();

src/common/Types.ts

-70
Original file line numberDiff line numberDiff line change
@@ -938,76 +938,6 @@ export interface PopupOptions {
938938
preventDismissOnPress?: boolean;
939939
}
940940

941-
//
942-
// Navigator
943-
// ----------------------------------------------------------------------
944-
export enum NavigatorSceneConfigType {
945-
FloatFromRight,
946-
FloatFromLeft,
947-
FloatFromBottom,
948-
Fade,
949-
FadeWithSlide
950-
}
951-
952-
export interface NavigatorRoute {
953-
routeId: number;
954-
// Route's animation configuration
955-
sceneConfigType: NavigatorSceneConfigType;
956-
957-
// NOTE: The following props are for the experimental navigator.
958-
// They aren't considered when working with the standard navigator.
959-
// Optional gesture response distance override
960-
// 0 is equivalent to disabling gestures
961-
gestureResponseDistance?: number;
962-
// Optional custom scene config
963-
customSceneConfig?: CustomNavigatorSceneConfig;
964-
}
965-
966-
// NOTE: Experimental navigator only
967-
export type NavigationTransitionSpec = {
968-
duration?: number;
969-
970-
// NOTE: Elastic and bounce easing will not work as expected due to how the navigator interpolates styles
971-
easing?: Animated.EasingFunction;
972-
};
973-
974-
// NOTE: Experimental navigator only
975-
export type NavigationTransitionStyleConfig = {
976-
// By default input range is defined as [index - 1, index, index + 1];
977-
// Input and output ranges must contain the same number of elements
978-
inputRange?: number[];
979-
opacityOutput: number | number[];
980-
scaleOutput: number | number[];
981-
translateXOutput: number | number[];
982-
translateYOutput: number | number[];
983-
};
984-
985-
// NOTE: Experimental navigator only
986-
export type CustomNavigatorSceneConfig = {
987-
// Optional transition styles
988-
transitionStyle?: (sceneIndex: number, sceneDimensions: Dimensions) => NavigationTransitionStyleConfig;
989-
// Optional overrides for duration, easing, and timing
990-
transitionSpec?: NavigationTransitionSpec;
991-
// Optional cardStyle override
992-
cardStyle?: ViewStyleRuleSet;
993-
// Optionally hide drop shadow
994-
hideShadow?: boolean;
995-
// Optionally flip the visual order of the last two scenes
996-
presentBelowPrevious?: boolean;
997-
};
998-
999-
export interface NavigatorProps extends CommonProps {
1000-
renderScene: (route: NavigatorRoute) => JSX.Element;
1001-
navigateBackCompleted?: () => void;
1002-
// NOTE: Arguments are only passed to transitionStarted by the experimental navigator
1003-
transitionStarted?: (progress?: RX.IAnimatedValue,
1004-
toRouteId?: string, fromRouteId?: string,
1005-
toIndex?: number, fromIndex?: number) => void;
1006-
transitionCompleted?: () => void;
1007-
cardStyle?: ViewStyleRuleSet;
1008-
children?: ReactNode;
1009-
}
1010-
1011941
//
1012942
// Alert
1013943
//

src/ios/ReactXP.ts

-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { default as LinkImpl, Link as LinkType } from '../native-common/Link';
3232
import { default as LinkingImpl, Linking as LinkingType } from './Linking';
3333
import { default as LocationImpl, Location as LocationType } from '../common/Location';
3434
import { default as ModalImpl, Modal as ModalType } from '../native-common/Modal';
35-
import { default as NavigatorImpl, Navigator as NavigatorType } from '../native-common/Navigator';
3635
import { default as NetworkImpl, Network as NetworkType } from '../native-common/Network';
3736
import { default as PlatformImpl, Platform as PlatformType } from '../native-common/Platform';
3837
import { default as PopupImpl, Popup as PopupType } from '../native-common/Popup';
@@ -98,8 +97,6 @@ module ReactXP {
9897
export var Location = LocationImpl;
9998
export type Modal = ModalType;
10099
export var Modal = ModalImpl;
101-
export type Navigator = NavigatorType;
102-
export var Navigator = NavigatorImpl;
103100
export type Network = NetworkType;
104101
export var Network = NetworkImpl;
105102
export type Platform = PlatformType;

0 commit comments

Comments
 (0)