@react-navigation/stack 8.0.0-alpha.4 → 8.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createStackNavigator.js +3 -7
- package/lib/module/navigators/createStackNavigator.js.map +1 -1
- package/lib/module/utils/GestureHandlerContext.js +5 -0
- package/lib/module/utils/GestureHandlerContext.js.map +1 -0
- package/lib/module/utils/gestureActivationCriteria.js +10 -8
- package/lib/module/utils/gestureActivationCriteria.js.map +1 -1
- package/lib/module/utils/useCardAnimation.js +1 -1
- package/lib/module/utils/useCardAnimation.js.map +1 -1
- package/lib/module/utils/useGestureHandler.js +9 -0
- package/lib/module/utils/useGestureHandler.js.map +1 -0
- package/lib/module/utils/useKeyboardManager.js +71 -26
- package/lib/module/utils/useKeyboardManager.js.map +1 -1
- package/lib/module/views/GestureHandler.js +15 -14
- package/lib/module/views/GestureHandler.js.map +1 -1
- package/lib/module/views/GestureHandlerNative.js +16 -10
- package/lib/module/views/GestureHandlerNative.js.map +1 -1
- package/lib/module/views/Header/Header.js +2 -2
- package/lib/module/views/Header/Header.js.map +1 -1
- package/lib/module/views/Header/HeaderContainer.js +52 -18
- package/lib/module/views/Header/HeaderContainer.js.map +1 -1
- package/lib/module/views/Header/HeaderSegment.js +2 -2
- package/lib/module/views/Header/HeaderSegment.js.map +1 -1
- package/lib/module/views/Stack/Card.js +90 -87
- package/lib/module/views/Stack/Card.js.map +1 -1
- package/lib/module/views/Stack/CardContainer.js +72 -98
- package/lib/module/views/Stack/CardContainer.js.map +1 -1
- package/lib/module/views/Stack/CardStack.js +171 -126
- package/lib/module/views/Stack/CardStack.js.map +1 -1
- package/lib/module/views/Stack/StackView.js +103 -53
- package/lib/module/views/Stack/StackView.js.map +1 -1
- package/lib/typescript/src/TransitionConfigs/CardStyleInterpolators.d.ts +1 -1
- package/lib/typescript/src/TransitionConfigs/CardStyleInterpolators.d.ts.map +1 -1
- package/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators.d.ts +1 -1
- package/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators.d.ts.map +1 -1
- package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts +1 -1
- package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -1
- package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts +1 -1
- package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +12 -12
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createStackNavigator.d.ts +10 -15
- package/lib/typescript/src/navigators/createStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +46 -53
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/CardAnimationContext.d.ts +1 -1
- package/lib/typescript/src/utils/CardAnimationContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/GestureHandlerContext.d.ts +3 -0
- package/lib/typescript/src/utils/GestureHandlerContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/gestureActivationCriteria.d.ts +4 -51
- package/lib/typescript/src/utils/gestureActivationCriteria.d.ts.map +1 -1
- package/lib/typescript/src/utils/getDistanceForDirection.d.ts +1 -1
- package/lib/typescript/src/utils/getDistanceForDirection.d.ts.map +1 -1
- package/lib/typescript/src/utils/getInvertedMultiplier.d.ts +1 -1
- package/lib/typescript/src/utils/getInvertedMultiplier.d.ts.map +1 -1
- package/lib/typescript/src/utils/getModalRoutesKeys.d.ts +1 -1
- package/lib/typescript/src/utils/getModalRoutesKeys.d.ts.map +1 -1
- package/lib/typescript/src/utils/useCardAnimation.d.ts +1 -1
- package/lib/typescript/src/utils/useCardAnimation.d.ts.map +1 -1
- package/lib/typescript/src/utils/useGestureHandler.d.ts +2 -0
- package/lib/typescript/src/utils/useGestureHandler.d.ts.map +1 -0
- package/lib/typescript/src/utils/useKeyboardManager.d.ts +12 -2
- package/lib/typescript/src/utils/useKeyboardManager.d.ts.map +1 -1
- package/lib/typescript/src/views/GestureHandler.android.d.ts +1 -1
- package/lib/typescript/src/views/GestureHandler.android.d.ts.map +1 -1
- package/lib/typescript/src/views/GestureHandler.d.ts +7 -11
- package/lib/typescript/src/views/GestureHandler.d.ts.map +1 -1
- package/lib/typescript/src/views/GestureHandler.ios.d.ts +1 -1
- package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +1 -1
- package/lib/typescript/src/views/GestureHandlerNative.d.ts +9 -4
- package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +1 -1
- package/lib/typescript/src/views/Header/Header.d.ts +2 -2
- package/lib/typescript/src/views/Header/Header.d.ts.map +1 -1
- package/lib/typescript/src/views/Header/HeaderContainer.d.ts +9 -3
- package/lib/typescript/src/views/Header/HeaderContainer.d.ts.map +1 -1
- package/lib/typescript/src/views/Header/HeaderSegment.d.ts +5 -4
- package/lib/typescript/src/views/Header/HeaderSegment.d.ts.map +1 -1
- package/lib/typescript/src/views/Stack/Card.d.ts +5 -5
- package/lib/typescript/src/views/Stack/Card.d.ts.map +1 -1
- package/lib/typescript/src/views/Stack/CardContainer.d.ts +5 -7
- package/lib/typescript/src/views/Stack/CardContainer.d.ts.map +1 -1
- package/lib/typescript/src/views/Stack/CardContent.d.ts +1 -1
- package/lib/typescript/src/views/Stack/CardContent.d.ts.map +1 -1
- package/lib/typescript/src/views/Stack/CardStack.d.ts +6 -5
- package/lib/typescript/src/views/Stack/CardStack.d.ts.map +1 -1
- package/lib/typescript/src/views/Stack/StackView.d.ts +10 -13
- package/lib/typescript/src/views/Stack/StackView.d.ts.map +1 -1
- package/package.json +21 -23
- package/src/index.tsx +3 -2
- package/src/navigators/createStackNavigator.tsx +9 -40
- package/src/types.tsx +73 -73
- package/src/utils/GestureHandlerContext.tsx +5 -0
- package/src/utils/gestureActivationCriteria.tsx +14 -10
- package/src/utils/useCardAnimation.tsx +1 -1
- package/src/utils/useGestureHandler.tsx +9 -0
- package/src/utils/useKeyboardManager.tsx +96 -33
- package/src/views/GestureHandler.tsx +27 -16
- package/src/views/GestureHandlerNative.tsx +26 -12
- package/src/views/Header/Header.tsx +2 -2
- package/src/views/Header/HeaderContainer.tsx +67 -24
- package/src/views/Header/HeaderSegment.tsx +4 -4
- package/src/views/Stack/Card.tsx +134 -115
- package/src/views/Stack/CardContainer.tsx +86 -127
- package/src/views/Stack/CardStack.tsx +380 -323
- package/src/views/Stack/StackView.tsx +173 -71
- package/lib/module/utils/GestureHandlerRefContext.js +0 -5
- package/lib/module/utils/GestureHandlerRefContext.js.map +0 -1
- package/lib/module/utils/findLastIndex.js +0 -11
- package/lib/module/utils/findLastIndex.js.map +0 -1
- package/lib/module/utils/useGestureHandlerRef.js +0 -12
- package/lib/module/utils/useGestureHandlerRef.js.map +0 -1
- package/lib/module/views/Stack/CardA11yWrapper.js +0 -43
- package/lib/module/views/Stack/CardA11yWrapper.js.map +0 -1
- package/lib/typescript/src/utils/GestureHandlerRefContext.d.ts +0 -3
- package/lib/typescript/src/utils/GestureHandlerRefContext.d.ts.map +0 -1
- package/lib/typescript/src/utils/findLastIndex.d.ts +0 -2
- package/lib/typescript/src/utils/findLastIndex.d.ts.map +0 -1
- package/lib/typescript/src/utils/useGestureHandlerRef.d.ts +0 -3
- package/lib/typescript/src/utils/useGestureHandlerRef.d.ts.map +0 -1
- package/lib/typescript/src/views/Stack/CardA11yWrapper.d.ts +0 -15
- package/lib/typescript/src/views/Stack/CardA11yWrapper.d.ts.map +0 -1
- package/src/utils/GestureHandlerRefContext.tsx +0 -5
- package/src/utils/findLastIndex.tsx +0 -9
- package/src/utils/useGestureHandlerRef.tsx +0 -15
- package/src/views/Stack/CardA11yWrapper.tsx +0 -67
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Route } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Animated } from 'react-native';
|
|
4
|
-
import type { Layout, Scene } from '../../types';
|
|
5
|
-
import type { Props as HeaderContainerProps } from '../Header/HeaderContainer';
|
|
4
|
+
import type { Layout, Scene } from '../../types.js';
|
|
5
|
+
import type { HeaderHeight, Props as HeaderContainerProps } from '../Header/HeaderContainer.js';
|
|
6
6
|
type Props = {
|
|
7
7
|
interpolationIndex: number;
|
|
8
8
|
index: number;
|
|
@@ -45,17 +45,15 @@ type Props = {
|
|
|
45
45
|
onGestureCancel: (props: {
|
|
46
46
|
route: Route<string>;
|
|
47
47
|
}) => void;
|
|
48
|
-
|
|
49
|
-
headerHeight: number;
|
|
48
|
+
headerHeight: HeaderHeight | undefined;
|
|
50
49
|
onHeaderHeightChange: (props: {
|
|
51
50
|
route: Route<string>;
|
|
52
51
|
height: number;
|
|
53
52
|
}) => void;
|
|
54
53
|
isParentHeaderShown: boolean;
|
|
55
|
-
|
|
56
|
-
detachCurrentScreen: boolean;
|
|
54
|
+
children: React.ReactNode;
|
|
57
55
|
};
|
|
58
|
-
declare function CardContainerInner({ interpolationIndex, index, active, opening, closing, gesture, focused, modal, getPreviousScene, getFocusedRoute,
|
|
56
|
+
declare function CardContainerInner({ interpolationIndex, index, active, opening, closing, gesture, focused, modal, getPreviousScene, getFocusedRoute, headerHeight, onHeaderHeightChange, isParentHeaderShown, layout, onCloseRoute, onOpenRoute, onGestureCancel, onGestureEnd, onGestureStart, onTransitionEnd, onTransitionStart, preloaded, renderHeader, safeAreaInsetBottom, safeAreaInsetLeft, safeAreaInsetRight, safeAreaInsetTop, scene, children, }: Props): React.JSX.Element;
|
|
59
57
|
export declare const CardContainer: React.MemoExoticComponent<typeof CardContainerInner>;
|
|
60
58
|
export {};
|
|
61
59
|
//# sourceMappingURL=CardContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContainer.d.ts","sourceRoot":"","sources":["../../../../../src/views/Stack/CardContainer.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,KAAK,EAIX,MAAM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M,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,KAAK,EACL,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,EACN,YAAY,EACZ,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,QAAQ,GACT,EAAE,KAAK,qBA8LP;AAED,eAAO,MAAM,aAAa,sDAAiC,CAAC"}
|
|
@@ -8,6 +8,6 @@ type Props = ViewProps & {
|
|
|
8
8
|
};
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
};
|
|
11
|
-
export declare function CardContent({ enabled, layout, style, ...rest }: Props):
|
|
11
|
+
export declare function CardContent({ enabled, layout, style, ...rest }: Props): React.JSX.Element;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=CardContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/views/Stack/CardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAMF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/views/Stack/CardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAMF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,qBAuErE"}
|
|
@@ -2,11 +2,12 @@ import type { LocaleDirection, ParamListBase, Route, StackNavigationState } from
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Animated } from 'react-native';
|
|
4
4
|
import type { EdgeInsets } from 'react-native-safe-area-context';
|
|
5
|
-
import type { Layout, Scene, StackAnimationName, StackDescriptorMap } from '../../types';
|
|
6
|
-
import type { Props as HeaderContainerProps } from '../Header/HeaderContainer';
|
|
5
|
+
import type { Layout, Scene, StackAnimationName, StackDescriptorMap } from '../../types.js';
|
|
6
|
+
import type { HeaderHeight, Props as HeaderContainerProps } from '../Header/HeaderContainer.js';
|
|
7
7
|
type GestureValues = {
|
|
8
8
|
[key: string]: Animated.Value;
|
|
9
9
|
};
|
|
10
|
+
type HeaderHeights = Record<string, HeaderHeight>;
|
|
10
11
|
type Props = {
|
|
11
12
|
direction: LocaleDirection;
|
|
12
13
|
insets: EdgeInsets;
|
|
@@ -15,6 +16,7 @@ type Props = {
|
|
|
15
16
|
routes: Route<string>[];
|
|
16
17
|
openingRouteKeys: string[];
|
|
17
18
|
closingRouteKeys: string[];
|
|
19
|
+
replacingRouteKeys: string[];
|
|
18
20
|
onOpenRoute: (props: {
|
|
19
21
|
route: Route<string>;
|
|
20
22
|
}) => void;
|
|
@@ -50,8 +52,7 @@ type State = {
|
|
|
50
52
|
scenes: Scene[];
|
|
51
53
|
gestures: GestureValues;
|
|
52
54
|
layout: Layout;
|
|
53
|
-
|
|
54
|
-
headerHeights: Record<string, number>;
|
|
55
|
+
headerHeights: HeaderHeights;
|
|
55
56
|
};
|
|
56
57
|
export declare function getAnimationEnabled(animation: StackAnimationName | undefined): boolean;
|
|
57
58
|
export declare class CardStack extends React.Component<Props, State> {
|
|
@@ -61,7 +62,7 @@ export declare class CardStack extends React.Component<Props, State> {
|
|
|
61
62
|
private handleHeaderLayout;
|
|
62
63
|
private getFocusedRoute;
|
|
63
64
|
private getPreviousScene;
|
|
64
|
-
render():
|
|
65
|
+
render(): React.JSX.Element;
|
|
65
66
|
}
|
|
66
67
|
export {};
|
|
67
68
|
//# sourceMappingURL=CardStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardStack.d.ts","sourceRoot":"","sources":["../../../../../src/views/Stack/CardStack.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CardStack.d.ts","sourceRoot":"","sources":["../../../../../src/views/Stack/CardStack.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,KAAK,EACL,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EAKT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAmBjE,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,kBAAkB,EAElB,kBAAkB,EAInB,MAAM,gBAAa,CAAC;AAGrB,OAAO,KAAK,EACV,YAAY,EACZ,KAAK,IAAI,oBAAoB,EAC9B,MAAM,8BAA2B,CAAC;AAGnC,KAAK,aAAa,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC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K,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1D,YAAY,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,eAAe,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3D,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;IACxB,WAAW,EAAE,kBAAkB,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAyLF,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,kBAAkB,GAAG,SAAS,WAE5E;AAuBD,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAC1D,MAAM,CAAC,wBAAwB,CAC7B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI;gBAuNZ,KAAK,EAAE,KAAK;IAkBxB,OAAO,CAAC,YAAY,CAsBlB;IAEF,OAAO,CAAC,kBAAkB,CAwBxB;IAEF,OAAO,CAAC,eAAe,CAUrB;IAEF,OAAO,CAAC,gBAAgB,CAetB;IAEF,MAAM;CAkQP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LocaleDirection, type ParamListBase, type Route, type StackNavigationState } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type { StackDescriptorMap, StackNavigationConfig, StackNavigationHelpers } from '../../types';
|
|
3
|
+
import type { StackDescriptorMap, StackNavigationConfig, StackNavigationHelpers } from '../../types.js';
|
|
4
4
|
type Props = StackNavigationConfig & {
|
|
5
5
|
direction: LocaleDirection;
|
|
6
6
|
state: StackNavigationState<ParamListBase>;
|
|
@@ -9,8 +9,7 @@ type Props = StackNavigationConfig & {
|
|
|
9
9
|
};
|
|
10
10
|
type State = {
|
|
11
11
|
routes: Route<string>[];
|
|
12
|
-
|
|
13
|
-
previousDescriptors: StackDescriptorMap;
|
|
12
|
+
previousState: StackNavigationState<ParamListBase> | undefined;
|
|
14
13
|
openingRouteKeys: string[];
|
|
15
14
|
closingRouteKeys: string[];
|
|
16
15
|
replacingRouteKeys: string[];
|
|
@@ -18,27 +17,25 @@ type State = {
|
|
|
18
17
|
};
|
|
19
18
|
export declare class StackView extends React.Component<Props, State> {
|
|
20
19
|
static getDerivedStateFromProps(props: Readonly<Props>, state: Readonly<State>): {
|
|
21
|
-
routes:
|
|
22
|
-
previousRoutes: Readonly<{
|
|
20
|
+
routes: Readonly<{
|
|
23
21
|
key: string;
|
|
24
22
|
name: string;
|
|
25
|
-
path?: string;
|
|
23
|
+
path?: string | undefined;
|
|
26
24
|
history?: {
|
|
27
25
|
type: "params";
|
|
28
26
|
params: object;
|
|
29
|
-
}[];
|
|
30
|
-
} &
|
|
27
|
+
}[] | undefined;
|
|
28
|
+
} & {
|
|
31
29
|
params?: Readonly<object | undefined>;
|
|
32
|
-
}
|
|
30
|
+
}>[];
|
|
31
|
+
previousState: StackNavigationState<ParamListBase>;
|
|
33
32
|
descriptors: StackDescriptorMap;
|
|
34
|
-
previousDescriptors: StackDescriptorMap;
|
|
35
33
|
openingRouteKeys?: undefined;
|
|
36
34
|
closingRouteKeys?: undefined;
|
|
37
35
|
replacingRouteKeys?: undefined;
|
|
38
36
|
} | {
|
|
39
37
|
routes: import("@react-navigation/routers").NavigationRoute<ParamListBase, string>[];
|
|
40
|
-
|
|
41
|
-
previousDescriptors: StackDescriptorMap;
|
|
38
|
+
previousState: StackNavigationState<ParamListBase>;
|
|
42
39
|
openingRouteKeys: string[];
|
|
43
40
|
closingRouteKeys: string[];
|
|
44
41
|
replacingRouteKeys: string[];
|
|
@@ -54,7 +51,7 @@ export declare class StackView extends React.Component<Props, State> {
|
|
|
54
51
|
private handleGestureStart;
|
|
55
52
|
private handleGestureEnd;
|
|
56
53
|
private handleGestureCancel;
|
|
57
|
-
render():
|
|
54
|
+
render(): React.JSX.Element;
|
|
58
55
|
}
|
|
59
56
|
export {};
|
|
60
57
|
//# sourceMappingURL=StackView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackView.d.ts","sourceRoot":"","sources":["../../../../../src/views/Stack/StackView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,KAAK,EAEV,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"StackView.d.ts","sourceRoot":"","sources":["../../../../../src/views/Stack/StackView.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,KAAK,EAEV,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,gBAAa,CAAC;AASrB,KAAK,KAAK,GAAG,qBAAqB,GAAG;IACnC,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAC3C,UAAU,EAAE,sBAAsB,CAAC;IACnC,WAAW,EAAE,kBAAkB,CAAC;CACjC,CAAC;AAEF,KAAK,KAAK,GAAG;IAEX,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;IAExB,aAAa,EAAE,oBAAoB,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IAE/D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAE3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAE3B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAG7B,WAAW,EAAE,kBAAkB,CAAC;CACjC,CAAC;AAWF,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAC1D,MAAM,CAAC,wBAAwB,CAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EACtB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;IA+RxB,KAAK,EAAE,KAAK,CAOV;IAEF,OAAO,CAAC,gBAAgB,CAYtB;IAEF,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,eAAe,CA+DrB;IAEF,OAAO,CAAC,gBAAgB,CA0BtB;IAEF,OAAO,CAAC,qBAAqB,CAQxB;IAEL,OAAO,CAAC,mBAAmB,CAQtB;IAEL,OAAO,CAAC,kBAAkB,CAKxB;IAEF,OAAO,CAAC,gBAAgB,CAKtB;IAEF,OAAO,CAAC,mBAAmB,CAKzB;IAEF,MAAM;CAwDP"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/stack",
|
|
3
3
|
"description": "Stack navigator component for iOS and Android with animated transitions and gestures",
|
|
4
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.40",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -45,33 +45,31 @@
|
|
|
45
45
|
"clean": "del lib"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@react-navigation/elements": "^3.0.0-alpha.
|
|
49
|
-
"
|
|
50
|
-
"use-latest-callback": "^0.3.2"
|
|
48
|
+
"@react-navigation/elements": "^3.0.0-alpha.35",
|
|
49
|
+
"use-latest-callback": "^0.3.4"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
|
-
"@jest/globals": "^
|
|
54
|
-
"@react-navigation/native": "^8.0.0-alpha.
|
|
55
|
-
"@testing-library/react-native": "^
|
|
56
|
-
"@types/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"react": "
|
|
60
|
-
"react-native": "0.
|
|
61
|
-
"react-native-
|
|
62
|
-
"react-native-
|
|
63
|
-
"react-native-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"typescript": "^5.9.2"
|
|
52
|
+
"@jest/globals": "^29.7.0",
|
|
53
|
+
"@react-navigation/native": "^8.0.0-alpha.31",
|
|
54
|
+
"@testing-library/react-native": "^14.0.0",
|
|
55
|
+
"@types/react": "~19.2.17",
|
|
56
|
+
"del-cli": "^7.0.0",
|
|
57
|
+
"react": "19.2.0",
|
|
58
|
+
"react-native": "0.83.6",
|
|
59
|
+
"react-native-builder-bob": "^0.42.1",
|
|
60
|
+
"react-native-gesture-handler": "^3.0.0",
|
|
61
|
+
"react-native-safe-area-context": "~5.6.2",
|
|
62
|
+
"react-native-screens": "^4.25.2",
|
|
63
|
+
"test-renderer": "1.2.0",
|
|
64
|
+
"typescript": "^6.0.3"
|
|
67
65
|
},
|
|
68
66
|
"peerDependencies": {
|
|
69
|
-
"@react-navigation/native": "^8.0.0-alpha.
|
|
70
|
-
"react": ">= 19.
|
|
67
|
+
"@react-navigation/native": "^8.0.0-alpha.31",
|
|
68
|
+
"react": ">= 19.2.0",
|
|
71
69
|
"react-native": "*",
|
|
72
|
-
"react-native-gesture-handler": ">=
|
|
70
|
+
"react-native-gesture-handler": ">= 3.0.0",
|
|
73
71
|
"react-native-safe-area-context": ">= 5.5.0",
|
|
74
|
-
"react-native-screens": ">= 4.
|
|
72
|
+
"react-native-screens": ">= 4.25.0"
|
|
75
73
|
},
|
|
76
74
|
"react-native-builder-bob": {
|
|
77
75
|
"source": "src",
|
|
@@ -91,5 +89,5 @@
|
|
|
91
89
|
]
|
|
92
90
|
]
|
|
93
91
|
},
|
|
94
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "8253da03842094df397a71e89924cc1e25d9d19e"
|
|
95
93
|
}
|
package/src/index.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
|
|
|
9
9
|
export {
|
|
10
10
|
createStackNavigator,
|
|
11
11
|
createStackScreen,
|
|
12
|
+
type StackTypeBag,
|
|
12
13
|
} from './navigators/createStackNavigator';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -31,9 +32,9 @@ export {
|
|
|
31
32
|
* Utilities
|
|
32
33
|
*/
|
|
33
34
|
export { CardAnimationContext } from './utils/CardAnimationContext';
|
|
34
|
-
export {
|
|
35
|
+
export { GestureHandlerContext } from './utils/GestureHandlerContext';
|
|
35
36
|
export { useCardAnimation } from './utils/useCardAnimation';
|
|
36
|
-
export {
|
|
37
|
+
export { useGestureHandler } from './utils/useGestureHandler';
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* Types
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createNavigatorFactory,
|
|
3
|
+
createScreenFactory,
|
|
3
4
|
type EventArg,
|
|
5
|
+
type NavigatorTypeBagBase,
|
|
4
6
|
type ParamListBase,
|
|
5
7
|
type StackActionHelpers,
|
|
6
8
|
StackActions,
|
|
7
9
|
type StackNavigationState,
|
|
8
10
|
StackRouter,
|
|
9
11
|
type StackRouterOptions,
|
|
10
|
-
type StaticConfig,
|
|
11
|
-
type StaticParamList,
|
|
12
|
-
type StaticScreenConfig,
|
|
13
|
-
type StaticScreenConfigLinking,
|
|
14
|
-
type StaticScreenConfigScreen,
|
|
15
|
-
type TypedNavigator,
|
|
16
12
|
useLocale,
|
|
17
13
|
useNavigationBuilder,
|
|
18
14
|
} from '@react-navigation/native';
|
|
@@ -21,7 +17,6 @@ import * as React from 'react';
|
|
|
21
17
|
import type {
|
|
22
18
|
StackNavigationEventMap,
|
|
23
19
|
StackNavigationOptions,
|
|
24
|
-
StackNavigationProp,
|
|
25
20
|
StackNavigatorProps,
|
|
26
21
|
} from '../types';
|
|
27
22
|
import { StackView } from '../views/Stack/StackView';
|
|
@@ -96,41 +91,15 @@ function StackNavigator({
|
|
|
96
91
|
);
|
|
97
92
|
}
|
|
98
93
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
State: StackNavigationState<ParamList>;
|
|
94
|
+
export interface StackTypeBag extends NavigatorTypeBagBase {
|
|
95
|
+
State: StackNavigationState<this['ParamList']>;
|
|
102
96
|
ScreenOptions: StackNavigationOptions;
|
|
103
97
|
EventMap: StackNavigationEventMap;
|
|
104
|
-
|
|
105
|
-
[RouteName in keyof ParamList]: StackNavigationProp<ParamList, RouteName>;
|
|
106
|
-
};
|
|
98
|
+
ActionHelpers: StackActionHelpers<this['ParamList']>;
|
|
107
99
|
Navigator: typeof StackNavigator;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export function createStackNavigator<
|
|
111
|
-
const ParamList extends ParamListBase,
|
|
112
|
-
>(): TypedNavigator<StackTypeBag<ParamList>, undefined>;
|
|
113
|
-
export function createStackNavigator<
|
|
114
|
-
const Config extends StaticConfig<StackTypeBag<ParamListBase>>,
|
|
115
|
-
>(
|
|
116
|
-
config: Config
|
|
117
|
-
): TypedNavigator<StackTypeBag<StaticParamList<{ config: Config }>>, Config>;
|
|
118
|
-
export function createStackNavigator(config?: unknown) {
|
|
119
|
-
return createNavigatorFactory(StackNavigator)(config);
|
|
120
100
|
}
|
|
121
101
|
|
|
122
|
-
export
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
>(
|
|
126
|
-
config: StaticScreenConfig<
|
|
127
|
-
Linking,
|
|
128
|
-
Screen,
|
|
129
|
-
StackNavigationState<ParamListBase>,
|
|
130
|
-
StackNavigationOptions,
|
|
131
|
-
StackNavigationEventMap,
|
|
132
|
-
StackNavigationProp<ParamListBase>
|
|
133
|
-
>
|
|
134
|
-
) {
|
|
135
|
-
return config;
|
|
136
|
-
}
|
|
102
|
+
export const createStackNavigator =
|
|
103
|
+
createNavigatorFactory<StackTypeBag>(StackNavigator);
|
|
104
|
+
|
|
105
|
+
export const createStackScreen = createScreenFactory<StackTypeBag>();
|
package/src/types.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
HeaderBackButton,
|
|
3
2
|
HeaderBackButtonDisplayMode,
|
|
4
3
|
HeaderBackButtonProps,
|
|
5
4
|
HeaderOptions,
|
|
6
5
|
HeaderTitleProps,
|
|
6
|
+
Icon,
|
|
7
7
|
} from '@react-navigation/elements';
|
|
8
8
|
import type {
|
|
9
9
|
DefaultNavigatorOptions,
|
|
@@ -138,12 +138,12 @@ export type SceneProgress = {
|
|
|
138
138
|
* Progress value for the screen after this one in the stack.
|
|
139
139
|
* This can be `undefined` in case the screen animating is the last one.
|
|
140
140
|
*/
|
|
141
|
-
next?: Animated.AnimatedInterpolation<number
|
|
141
|
+
next?: Animated.AnimatedInterpolation<number> | undefined;
|
|
142
142
|
/**
|
|
143
143
|
* Progress value for the screen before this one in the stack.
|
|
144
144
|
* This can be `undefined` in case the screen animating is the first one.
|
|
145
145
|
*/
|
|
146
|
-
previous?: Animated.AnimatedInterpolation<number
|
|
146
|
+
previous?: Animated.AnimatedInterpolation<number> | undefined;
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
export type StackHeaderMode = 'float' | 'screen';
|
|
@@ -187,14 +187,14 @@ export type StackHeaderOptions = Omit<
|
|
|
187
187
|
* Defaults to the previous screen's title, or "Back" if there's not enough space.
|
|
188
188
|
* Use `headerBackButtonDisplayMode` to customize the behavior.
|
|
189
189
|
*/
|
|
190
|
-
headerBackTitle?: string;
|
|
190
|
+
headerBackTitle?: string | undefined;
|
|
191
191
|
/**
|
|
192
192
|
* Title string used by the back button when `headerBackTitle` doesn't fit on the screen.
|
|
193
193
|
* Use `headerBackButtonDisplayMode` to customize the behavior.
|
|
194
194
|
*
|
|
195
195
|
* Defaults to "Back".
|
|
196
196
|
*/
|
|
197
|
-
headerBackTruncatedTitle?: string;
|
|
197
|
+
headerBackTruncatedTitle?: string | undefined;
|
|
198
198
|
/**
|
|
199
199
|
* How the back button displays icon and title.
|
|
200
200
|
*
|
|
@@ -211,27 +211,47 @@ export type StackHeaderOptions = Omit<
|
|
|
211
211
|
*/
|
|
212
212
|
headerBackTitleStyle?: StyleProp<TextStyle>;
|
|
213
213
|
/**
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
* Icon to display in the header in the back button.
|
|
215
|
+
*
|
|
216
|
+
* Supported types:
|
|
217
|
+
* - image: custom image source
|
|
218
|
+
* - sfSymbol: SF Symbol icon (iOS only)
|
|
219
|
+
* - materialSymbol: material symbol icon (Android only)
|
|
220
|
+
* - React Node: function that returns a React Element
|
|
221
|
+
*
|
|
222
|
+
* Defaults to back icon image for the platform
|
|
223
|
+
* - A chevron on iOS
|
|
224
|
+
* - An arrow on Android
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```js
|
|
228
|
+
* headerBackIcon: {
|
|
229
|
+
* type: 'image',
|
|
230
|
+
* source: require('./back-icon.png'),
|
|
231
|
+
* }
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
headerBackIcon?:
|
|
235
|
+
| Icon
|
|
236
|
+
| ((props: { tintColor: ColorValue | undefined }) => React.ReactNode);
|
|
219
237
|
};
|
|
220
238
|
|
|
221
239
|
export type StackHeaderProps = {
|
|
222
240
|
/**
|
|
223
241
|
* Options for the back button.
|
|
224
242
|
*/
|
|
225
|
-
back?:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
243
|
+
back?:
|
|
244
|
+
| {
|
|
245
|
+
/**
|
|
246
|
+
* Title of the previous screen.
|
|
247
|
+
*/
|
|
248
|
+
title: string | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* The `href` to use for the anchor tag on web
|
|
251
|
+
*/
|
|
252
|
+
href: string | undefined;
|
|
253
|
+
}
|
|
254
|
+
| undefined;
|
|
235
255
|
/**
|
|
236
256
|
* Animated nodes representing the progress of the animation.
|
|
237
257
|
*/
|
|
@@ -258,26 +278,26 @@ export type StackHeaderRightProps = {
|
|
|
258
278
|
/**
|
|
259
279
|
* Tint color for the header button.
|
|
260
280
|
*/
|
|
261
|
-
tintColor?: ColorValue;
|
|
281
|
+
tintColor?: ColorValue | undefined;
|
|
262
282
|
/**
|
|
263
283
|
* Color for material ripple (Android >= 5.0 only).
|
|
264
284
|
*/
|
|
265
|
-
pressColor?: ColorValue;
|
|
285
|
+
pressColor?: ColorValue | undefined;
|
|
266
286
|
/**
|
|
267
287
|
* Opacity when the button is pressed, used when ripple is not supported.
|
|
268
288
|
*/
|
|
269
|
-
pressOpacity?: number;
|
|
289
|
+
pressOpacity?: number | undefined;
|
|
270
290
|
/**
|
|
271
291
|
* Whether it's possible to navigate back in stack.
|
|
272
292
|
*/
|
|
273
|
-
canGoBack?: boolean;
|
|
293
|
+
canGoBack?: boolean | undefined;
|
|
274
294
|
};
|
|
275
295
|
|
|
276
296
|
export type StackHeaderLeftProps = HeaderBackButtonProps & {
|
|
277
297
|
/**
|
|
278
298
|
* Whether it's possible to navigate back in stack.
|
|
279
299
|
*/
|
|
280
|
-
canGoBack?: boolean;
|
|
300
|
+
canGoBack?: boolean | undefined;
|
|
281
301
|
};
|
|
282
302
|
|
|
283
303
|
export type StackDescriptor = Descriptor<
|
|
@@ -326,15 +346,6 @@ export type StackNavigationOptions = StackHeaderOptions &
|
|
|
326
346
|
/**
|
|
327
347
|
* Style object for the card in stack.
|
|
328
348
|
* You can provide a custom background color to use instead of the default background here.
|
|
329
|
-
*
|
|
330
|
-
* You can also specify `{ backgroundColor: 'transparent' }` to make the previous screen visible underneath.
|
|
331
|
-
* This is useful to implement things like modal dialogs.
|
|
332
|
-
*
|
|
333
|
-
* You should also specify `detachPreviousScreen: false` in options when using a transparent background
|
|
334
|
-
* so that the previous screen isn't detached and stays below the current screen.
|
|
335
|
-
*
|
|
336
|
-
* You might also need to change the animation of the screen using `cardStyleInterpolator`
|
|
337
|
-
* so that the previous screen isn't transformed or invisible.
|
|
338
349
|
*/
|
|
339
350
|
cardStyle?: StyleProp<ViewStyle>;
|
|
340
351
|
/**
|
|
@@ -348,7 +359,6 @@ export type StackNavigationOptions = StackHeaderOptions &
|
|
|
348
359
|
* - `transparentModal`: Similar to `modal`. This changes following things:
|
|
349
360
|
* - Sets `headerMode` to `screen` for the screen unless specified otherwise.
|
|
350
361
|
* - Sets background color of the screen to transparent, so previous screen is visible
|
|
351
|
-
* - Adjusts the `detachPreviousScreen` option so that the previous screen stays rendered.
|
|
352
362
|
* - Prevents the previous screen from animating from its last position.
|
|
353
363
|
* - Changes the screen animation to a vertical slide animation.
|
|
354
364
|
*
|
|
@@ -390,43 +400,29 @@ export type StackNavigationOptions = StackHeaderOptions &
|
|
|
390
400
|
* Not supported on Web.
|
|
391
401
|
*/
|
|
392
402
|
gestureVelocityImpact?: number;
|
|
393
|
-
/**
|
|
394
|
-
* Whether to detach the previous screen from the view hierarchy to save memory.
|
|
395
|
-
* Set it to `false` if you need the previous screen to be seen through the active screen.
|
|
396
|
-
* Only applicable if `detachInactiveScreens` isn't set to `false`.
|
|
397
|
-
* Defaults to `false` for the last screen for modals, otherwise `true`.
|
|
398
|
-
*/
|
|
399
|
-
detachPreviousScreen?: boolean;
|
|
400
403
|
/**
|
|
401
404
|
* If `false`, the keyboard will NOT automatically dismiss when navigating to a new screen from this screen.
|
|
402
405
|
* Defaults to `true`.
|
|
403
406
|
*/
|
|
404
407
|
keyboardHandlingEnabled?: boolean;
|
|
408
|
+
|
|
405
409
|
/**
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
410
|
+
* What should happen when screens become inactive.
|
|
411
|
+
* - `pause`: Effects are cleaned up
|
|
412
|
+
* - `unmount`: Screen is unmounted
|
|
413
|
+
* - `none`: Screen renders normally
|
|
409
414
|
*
|
|
410
|
-
*
|
|
411
|
-
*/
|
|
412
|
-
freezeOnBlur?: boolean;
|
|
413
|
-
/**
|
|
414
|
-
* Whether the home indicator should prefer to stay hidden on this screen. Defaults to `false`.
|
|
415
|
+
* Defaults to `pause`.
|
|
415
416
|
*
|
|
416
|
-
*
|
|
417
|
+
* Preloaded screens won't be paused until after navigated to.
|
|
418
|
+
* This makes sure that effects are run to initialize the screen.
|
|
419
|
+
*
|
|
420
|
+
* Screens with nested navigators and last 2 screens won't be unmounted.
|
|
417
421
|
*/
|
|
418
|
-
|
|
422
|
+
inactiveBehavior?: 'pause' | 'unmount' | 'none' | undefined;
|
|
419
423
|
};
|
|
420
424
|
|
|
421
|
-
export type StackNavigationConfig = {
|
|
422
|
-
/**
|
|
423
|
-
* Whether inactive screens should be detached from the view hierarchy to save memory.
|
|
424
|
-
* This will have no effect if you disable `react-native-screens`.
|
|
425
|
-
*
|
|
426
|
-
* Defaults to `true`.
|
|
427
|
-
*/
|
|
428
|
-
detachInactiveScreens?: boolean;
|
|
429
|
-
};
|
|
425
|
+
export type StackNavigationConfig = {};
|
|
430
426
|
|
|
431
427
|
export type TransitionSpec =
|
|
432
428
|
| {
|
|
@@ -458,12 +454,14 @@ export type StackCardInterpolationProps = {
|
|
|
458
454
|
* Values for the screen after this one in the stack.
|
|
459
455
|
* This can be `undefined` in case the screen animating is the last one.
|
|
460
456
|
*/
|
|
461
|
-
next?:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
457
|
+
next?:
|
|
458
|
+
| {
|
|
459
|
+
/**
|
|
460
|
+
* Animated node representing the progress value of the next screen.
|
|
461
|
+
*/
|
|
462
|
+
progress: Animated.AnimatedInterpolation<number>;
|
|
463
|
+
}
|
|
464
|
+
| undefined;
|
|
467
465
|
/**
|
|
468
466
|
* The index of the card with this interpolation in the stack.
|
|
469
467
|
*/
|
|
@@ -537,12 +535,14 @@ export type StackHeaderInterpolationProps = {
|
|
|
537
535
|
* Values for the screen after this one in the stack.
|
|
538
536
|
* This can be `undefined` in case the screen animating is the last one.
|
|
539
537
|
*/
|
|
540
|
-
next?:
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
538
|
+
next?:
|
|
539
|
+
| {
|
|
540
|
+
/**
|
|
541
|
+
* Animated node representing the progress value of the next screen.
|
|
542
|
+
*/
|
|
543
|
+
progress: Animated.AnimatedInterpolation<number>;
|
|
544
|
+
}
|
|
545
|
+
| undefined;
|
|
546
546
|
/**
|
|
547
547
|
* Writing direction of the layout.
|
|
548
548
|
*/
|