Skip to content

Commit fbba079

Browse files
committed
Navigation API removal
1 parent 96f0942 commit fbba079

14 files changed

+1
-1913
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

-13
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export interface ReactXP {
3232
Storage: Storage;
3333
Location: Location;
3434
Modal: Modal;
35-
Navigator: typeof Navigator;
3635
Network: Network;
3736
Platform: Platform;
3837
Popup: Popup;
@@ -196,18 +195,6 @@ export interface LocationConfiguration {
196195
skipPermissionRequests: boolean;
197196
}
198197

199-
export abstract class Navigator<S> extends React.Component<Types.NavigatorProps, S> {
200-
abstract push(route: Types.NavigatorRoute): void;
201-
abstract pop(): void;
202-
abstract replace(route: Types.NavigatorRoute): void;
203-
abstract replacePrevious(route: Types.NavigatorRoute): void;
204-
abstract replaceAtIndex(route: Types.NavigatorRoute, index: number): void;
205-
abstract immediatelyResetRouteStack(nextRouteStack: Types.NavigatorRoute[]): void;
206-
abstract popToRoute(route: Types.NavigatorRoute): void;
207-
abstract popToTop(): void;
208-
abstract getCurrentRoutes(): Types.NavigatorRoute[];
209-
}
210-
211198
export enum DeviceNetworkType {
212199
UNKNOWN,
213200
NONE,

src/common/Types.ts

-70
Original file line numberDiff line numberDiff line change
@@ -926,76 +926,6 @@ export interface PopupOptions {
926926
dismissIfShown?: boolean;
927927
}
928928

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

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)