@react-navigation/native-stack 7.18.9 → 7.19.0
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/navigators/createNativeStackNavigator.js +8 -10
- package/lib/module/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/typescript/src/navigators/createNativeStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +4 -4
- package/package.json +5 -5
- package/src/navigators/createNativeStackNavigator.tsx +9 -11
- package/src/types.tsx +4 -4
|
@@ -21,7 +21,7 @@ function NativeStackNavigator({
|
|
|
21
21
|
describe,
|
|
22
22
|
descriptors,
|
|
23
23
|
navigation,
|
|
24
|
-
|
|
24
|
+
render
|
|
25
25
|
} = useNavigationBuilder(StackRouter, {
|
|
26
26
|
id,
|
|
27
27
|
initialRouteName,
|
|
@@ -66,15 +66,13 @@ function NativeStackNavigator({
|
|
|
66
66
|
unsubscribe?.();
|
|
67
67
|
};
|
|
68
68
|
}, [meta, navigation]);
|
|
69
|
-
return /*#__PURE__*/_jsx(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
})
|
|
77
|
-
});
|
|
69
|
+
return render(/*#__PURE__*/_jsx(NativeStackView, {
|
|
70
|
+
...rest,
|
|
71
|
+
state: state,
|
|
72
|
+
navigation: navigation,
|
|
73
|
+
descriptors: descriptors,
|
|
74
|
+
describe: describe
|
|
75
|
+
}));
|
|
78
76
|
}
|
|
79
77
|
export function createNativeStackNavigator(config) {
|
|
80
78
|
return createNavigatorFactory(NativeStackNavigator)(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createNavigatorFactory","createScreenFactory","NavigationMetaContext","StackActions","StackRouter","useNavigationBuilder","React","NativeStackView","jsx","_jsx","NativeStackNavigator","id","initialRouteName","UNSTABLE_routeNamesChangeBehavior","children","layout","screenListeners","screenOptions","screenLayout","UNSTABLE_router","rest","state","describe","descriptors","navigation","
|
|
1
|
+
{"version":3,"names":["createNavigatorFactory","createScreenFactory","NavigationMetaContext","StackActions","StackRouter","useNavigationBuilder","React","NativeStackView","jsx","_jsx","NativeStackNavigator","id","initialRouteName","UNSTABLE_routeNamesChangeBehavior","children","layout","screenListeners","screenOptions","screenLayout","UNSTABLE_router","rest","state","describe","descriptors","navigation","render","meta","useContext","useEffect","type","handle","unsubscribe","addListener","e","isFocused","cancelAnimationFrame","requestAnimationFrame","currentState","getState","index","defaultPrevented","dispatch","popToTop","target","key","createNativeStackNavigator","config","createNativeStackScreen"],"sourceRoot":"../../../src","sources":["navigators/createNativeStackNavigator.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EACtBC,mBAAmB,EAEnBC,qBAAqB,EAIrBC,YAAY,EAEZC,WAAW,EAIXC,oBAAoB,QACf,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAQ9B,SAASC,eAAe,QAAQ,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,SAASC,oBAAoBA,CAAC;EAC5BC,EAAE;EACFC,gBAAgB;EAChBC,iCAAiC;EACjCC,QAAQ;EACRC,MAAM;EACNC,eAAe;EACfC,aAAa;EACbC,YAAY;EACZC,eAAe;EACf,GAAGC;AACsB,CAAC,EAAE;EAC5B,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAO,CAAC,GACxDpB,oBAAoB,CAMlBD,WAAW,EAAE;IACbO,EAAE;IACFC,gBAAgB;IAChBC,iCAAiC;IACjCC,QAAQ;IACRC,MAAM;IACNC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC;EACF,CAAC,CAAC;EAEJ,MAAMO,IAAI,GAAGpB,KAAK,CAACqB,UAAU,CAACzB,qBAAqB,CAAC;EAEpDI,KAAK,CAACsB,SAAS,CAAC,MAAM;IACpB,IAAIF,IAAI,IAAI,MAAM,IAAIA,IAAI,IAAIA,I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","sourceRoot":"","sources":["../../../../src/navigators/createNativeStackNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAGlB,KAAK,oBAAoB,EAGzB,KAAK,YAAY,EACjB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,aAAU,CAAC;AAGlB,iBAAS,oBAAoB,CAAC,EAC5B,EAAE,EACF,gBAAgB,EAChB,iCAAiC,EACjC,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,GAAG,IAAI,EACR,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"createNativeStackNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createNativeStackNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAGlB,KAAK,oBAAoB,EAGzB,KAAK,YAAY,EACjB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,aAAU,CAAC;AAGlB,iBAAS,oBAAoB,CAAC,EAC5B,EAAE,EACF,gBAAgB,EAChB,iCAAiC,EACjC,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,GAAG,IAAI,EACR,EAAE,yBAAyB,qBAwE3B;AAED,MAAM,MAAM,kBAAkB,CAC5B,SAAS,SAAS,aAAa,GAAG,aAAa,EAC/C,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACzD;IACF,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACvC,aAAa,EAAE,4BAA4B,CAAC;IAC5C,QAAQ,EAAE,6BAA6B,CAAC;IACxC,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,yBAAyB,CACvD,SAAS,EACT,SAAS,EACT,WAAW,CACZ;KACF,CAAC;IACF,SAAS,EAAE,OAAO,oBAAoB,CAAC;CACxC,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,SAAS,SAAS,aAAa,EACrC,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACjE,KAAK,CAAC,OAAO,SAAS,oBAAoB,GAAG,kBAAkB,CAC7D,SAAS,EACT,WAAW,CACZ,EACD,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,EAClE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD;AAED,eAAO,MAAM,uBAAuB,6GACO,CAAC"}
|
|
@@ -275,13 +275,13 @@ export type NativeStackNavigationOptions = {
|
|
|
275
275
|
headerBackground?: () => React.ReactNode;
|
|
276
276
|
/**
|
|
277
277
|
* Function which returns a React Element to display on the left side of the header.
|
|
278
|
-
* This replaces the back button. See `headerBackVisible` to show the back button
|
|
279
|
-
* Will be
|
|
278
|
+
* This replaces the back button. See `headerBackVisible` to show the back button alongside the left element.
|
|
279
|
+
* Will be overridden by `headerLeftItems` on iOS.
|
|
280
280
|
*/
|
|
281
281
|
headerLeft?: (props: NativeStackHeaderBackProps) => React.ReactNode;
|
|
282
282
|
/**
|
|
283
283
|
* Function which returns a React Element to display on the right side of the header.
|
|
284
|
-
* Will be
|
|
284
|
+
* Will be overridden by `headerRightItems` on iOS.
|
|
285
285
|
*/
|
|
286
286
|
headerRight?: (props: NativeStackHeaderItemProps) => React.ReactNode;
|
|
287
287
|
/**
|
|
@@ -550,7 +550,7 @@ export type NativeStackNavigationOptions = {
|
|
|
550
550
|
*/
|
|
551
551
|
gestureResponseDistance?: ScreenProps['gestureResponseDistance'];
|
|
552
552
|
/**
|
|
553
|
-
* The type of animation to use when this screen replaces another screen. Defaults to `
|
|
553
|
+
* The type of animation to use when this screen replaces another screen. Defaults to `push`.
|
|
554
554
|
*
|
|
555
555
|
* Supported values:
|
|
556
556
|
* - "push": the new screen will perform push animation.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/native-stack",
|
|
3
3
|
"description": "Native stack navigator using react-native-screens",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.19.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"clean": "del lib"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@react-navigation/elements": "^2.9.
|
|
49
|
+
"@react-navigation/elements": "^2.9.41",
|
|
50
50
|
"color": "^4.2.3",
|
|
51
51
|
"sf-symbols-typescript": "^2.1.0",
|
|
52
52
|
"warn-once": "^0.1.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@jest/globals": "^30.0.0",
|
|
56
|
-
"@react-navigation/native": "^7.
|
|
56
|
+
"@react-navigation/native": "^7.4.0",
|
|
57
57
|
"@testing-library/react-native": "^13.2.1",
|
|
58
58
|
"@types/react": "~19.2.4",
|
|
59
59
|
"del-cli": "^6.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"typescript": "~6.0.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@react-navigation/native": "^7.
|
|
68
|
+
"@react-navigation/native": "^7.4.0",
|
|
69
69
|
"react": ">= 18.2.0",
|
|
70
70
|
"react-native": "*",
|
|
71
71
|
"react-native-safe-area-context": ">= 4.0.0",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
]
|
|
90
90
|
]
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "c56a43f63778adf90170224f98407e609efd450f"
|
|
93
93
|
}
|
|
@@ -36,7 +36,7 @@ function NativeStackNavigator({
|
|
|
36
36
|
UNSTABLE_router,
|
|
37
37
|
...rest
|
|
38
38
|
}: NativeStackNavigatorProps) {
|
|
39
|
-
const { state, describe, descriptors, navigation,
|
|
39
|
+
const { state, describe, descriptors, navigation, render } =
|
|
40
40
|
useNavigationBuilder<
|
|
41
41
|
StackNavigationState<ParamListBase>,
|
|
42
42
|
StackRouterOptions,
|
|
@@ -98,16 +98,14 @@ function NativeStackNavigator({
|
|
|
98
98
|
};
|
|
99
99
|
}, [meta, navigation]);
|
|
100
100
|
|
|
101
|
-
return (
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
/>
|
|
110
|
-
</NavigationContent>
|
|
101
|
+
return render(
|
|
102
|
+
<NativeStackView
|
|
103
|
+
{...rest}
|
|
104
|
+
state={state}
|
|
105
|
+
navigation={navigation}
|
|
106
|
+
descriptors={descriptors}
|
|
107
|
+
describe={describe}
|
|
108
|
+
/>
|
|
111
109
|
);
|
|
112
110
|
}
|
|
113
111
|
|
package/src/types.tsx
CHANGED
|
@@ -319,13 +319,13 @@ export type NativeStackNavigationOptions = {
|
|
|
319
319
|
headerBackground?: () => React.ReactNode;
|
|
320
320
|
/**
|
|
321
321
|
* Function which returns a React Element to display on the left side of the header.
|
|
322
|
-
* This replaces the back button. See `headerBackVisible` to show the back button
|
|
323
|
-
* Will be
|
|
322
|
+
* This replaces the back button. See `headerBackVisible` to show the back button alongside the left element.
|
|
323
|
+
* Will be overridden by `headerLeftItems` on iOS.
|
|
324
324
|
*/
|
|
325
325
|
headerLeft?: (props: NativeStackHeaderBackProps) => React.ReactNode;
|
|
326
326
|
/**
|
|
327
327
|
* Function which returns a React Element to display on the right side of the header.
|
|
328
|
-
* Will be
|
|
328
|
+
* Will be overridden by `headerRightItems` on iOS.
|
|
329
329
|
*/
|
|
330
330
|
headerRight?: (props: NativeStackHeaderItemProps) => React.ReactNode;
|
|
331
331
|
/**
|
|
@@ -602,7 +602,7 @@ export type NativeStackNavigationOptions = {
|
|
|
602
602
|
*/
|
|
603
603
|
gestureResponseDistance?: ScreenProps['gestureResponseDistance'];
|
|
604
604
|
/**
|
|
605
|
-
* The type of animation to use when this screen replaces another screen. Defaults to `
|
|
605
|
+
* The type of animation to use when this screen replaces another screen. Defaults to `push`.
|
|
606
606
|
*
|
|
607
607
|
* Supported values:
|
|
608
608
|
* - "push": the new screen will perform push animation.
|