@react-navigation/core 6.4.8 → 6.4.10
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/commonjs/checkDuplicateRouteNames.js.map +1 -1
- package/lib/commonjs/useDescriptors.js +3 -1
- package/lib/commonjs/useDescriptors.js.map +1 -1
- package/lib/commonjs/useNavigationBuilder.js +1 -1
- package/lib/commonjs/useNavigationBuilder.js.map +1 -1
- package/lib/module/checkDuplicateRouteNames.js.map +1 -1
- package/lib/module/useDescriptors.js +3 -1
- package/lib/module/useDescriptors.js.map +1 -1
- package/lib/module/useNavigationBuilder.js +1 -1
- package/lib/module/useNavigationBuilder.js.map +1 -1
- package/lib/typescript/src/EnsureSingleNavigator.d.ts +1 -1
- package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +1 -1
- package/lib/typescript/src/NavigationBuilderContext.d.ts +9 -9
- package/lib/typescript/src/NavigationBuilderContext.d.ts.map +1 -1
- package/lib/typescript/src/PreventRemoveContext.d.ts +1 -1
- package/lib/typescript/src/PreventRemoveContext.d.ts.map +1 -1
- package/lib/typescript/src/PreventRemoveProvider.d.ts +1 -1
- package/lib/typescript/src/PreventRemoveProvider.d.ts.map +1 -1
- package/lib/typescript/src/SceneView.d.ts +1 -2
- package/lib/typescript/src/SceneView.d.ts.map +1 -1
- package/lib/typescript/src/getActionFromState.d.ts +2 -2
- package/lib/typescript/src/getActionFromState.d.ts.map +1 -1
- package/lib/typescript/src/getPathFromState.d.ts +2 -2
- package/lib/typescript/src/getPathFromState.d.ts.map +1 -1
- package/lib/typescript/src/getStateFromPath.d.ts +2 -2
- package/lib/typescript/src/getStateFromPath.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +29 -29
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useComponent.d.ts +1 -1
- package/lib/typescript/src/useComponent.d.ts.map +1 -1
- package/lib/typescript/src/useCurrentRender.d.ts +1 -1
- package/lib/typescript/src/useCurrentRender.d.ts.map +1 -1
- package/lib/typescript/src/useDescriptors.d.ts +3 -3
- package/lib/typescript/src/useDescriptors.d.ts.map +1 -1
- package/lib/typescript/src/useEventEmitter.d.ts +1 -1
- package/lib/typescript/src/useEventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/useFocusEffect.d.ts +1 -1
- package/lib/typescript/src/useFocusEffect.d.ts.map +1 -1
- package/lib/typescript/src/useFocusEvents.d.ts +1 -1
- package/lib/typescript/src/useFocusEvents.d.ts.map +1 -1
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts +1 -1
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationBuilder.d.ts +1 -1
- package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationCache.d.ts +2 -2
- package/lib/typescript/src/useNavigationCache.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationHelpers.d.ts +1 -1
- package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationState.d.ts +1 -1
- package/lib/typescript/src/useNavigationState.d.ts.map +1 -1
- package/lib/typescript/src/useOnAction.d.ts +1 -1
- package/lib/typescript/src/useOnAction.d.ts.map +1 -1
- package/lib/typescript/src/useOnGetState.d.ts +1 -1
- package/lib/typescript/src/useOnGetState.d.ts.map +1 -1
- package/lib/typescript/src/useOnPreventRemove.d.ts +1 -1
- package/lib/typescript/src/useOnPreventRemove.d.ts.map +1 -1
- package/lib/typescript/src/useOnRouteFocus.d.ts +1 -1
- package/lib/typescript/src/useOnRouteFocus.d.ts.map +1 -1
- package/lib/typescript/src/useOptionsGetters.d.ts +1 -1
- package/lib/typescript/src/useOptionsGetters.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/checkDuplicateRouteNames.tsx +1 -1
- package/src/getPathFromState.tsx +1 -1
- package/src/types.tsx +1 -1
- package/src/useDescriptors.tsx +1 -0
- package/src/useNavigationBuilder.tsx +6 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/core",
|
|
3
3
|
"description": "Core utilities for building navigators",
|
|
4
|
-
"version": "6.4.
|
|
4
|
+
"version": "6.4.10",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"react-native",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"clean": "del lib"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@react-navigation/routers": "^6.1.
|
|
38
|
+
"@react-navigation/routers": "^6.1.9",
|
|
39
39
|
"escape-string-regexp": "^4.0.0",
|
|
40
40
|
"nanoid": "^3.1.23",
|
|
41
41
|
"query-string": "^7.1.3",
|
|
42
42
|
"react-is": "^16.13.0",
|
|
43
|
-
"use-latest-callback": "^0.1.
|
|
43
|
+
"use-latest-callback": "^0.1.7"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@testing-library/react-native": "^11.5.0",
|
|
47
|
-
"@types/react": "~18.0.
|
|
47
|
+
"@types/react": "~18.0.27",
|
|
48
48
|
"@types/react-is": "^17.0.0",
|
|
49
|
-
"del-cli": "^
|
|
49
|
+
"del-cli": "^5.0.0",
|
|
50
50
|
"immer": "^9.0.2",
|
|
51
|
-
"react": "18.
|
|
51
|
+
"react": "18.2.0",
|
|
52
52
|
"react-native-builder-bob": "^0.20.4",
|
|
53
|
-
"react-test-renderer": "18.
|
|
54
|
-
"typescript": "^4.
|
|
53
|
+
"react-test-renderer": "18.1.0",
|
|
54
|
+
"typescript": "^4.9.4"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": "*"
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
]
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "f632ec3ecb5a6401b904222c75267dadba1c4b61"
|
|
74
74
|
}
|
|
@@ -7,7 +7,7 @@ export default function checkDuplicateRouteNames(state: NavigationState) {
|
|
|
7
7
|
location: string,
|
|
8
8
|
state: NavigationState | PartialState<NavigationState>
|
|
9
9
|
) => {
|
|
10
|
-
state.routes.forEach((route: typeof state.routes[0]) => {
|
|
10
|
+
state.routes.forEach((route: (typeof state.routes)[0]) => {
|
|
11
11
|
const currentLocation = location
|
|
12
12
|
? `${location} > ${route.name}`
|
|
13
13
|
: route.name;
|
package/src/getPathFromState.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import fromEntries from './fromEntries';
|
|
|
9
9
|
import type { PathConfig, PathConfigMap } from './types';
|
|
10
10
|
import validatePathConfig from './validatePathConfig';
|
|
11
11
|
|
|
12
|
-
type Options<ParamList> = {
|
|
12
|
+
type Options<ParamList extends {}> = {
|
|
13
13
|
initialRouteName?: string;
|
|
14
14
|
screens: PathConfigMap<ParamList>;
|
|
15
15
|
};
|
package/src/types.tsx
CHANGED
|
@@ -702,7 +702,7 @@ export type PathConfig<ParamList extends {}> = {
|
|
|
702
702
|
export type PathConfigMap<ParamList extends {}> = {
|
|
703
703
|
[RouteName in keyof ParamList]?: NonNullable<
|
|
704
704
|
ParamList[RouteName]
|
|
705
|
-
> extends NavigatorScreenParams<infer T
|
|
705
|
+
> extends NavigatorScreenParams<infer T extends {}>
|
|
706
706
|
? string | PathConfig<T>
|
|
707
707
|
: string | Omit<PathConfig<{}>, 'screens' | 'initialRouteName'>;
|
|
708
708
|
};
|
package/src/useDescriptors.tsx
CHANGED
|
@@ -177,6 +177,7 @@ export default function useDescriptors<
|
|
|
177
177
|
(acc, curr) =>
|
|
178
178
|
Object.assign(
|
|
179
179
|
acc,
|
|
180
|
+
// @ts-expect-error: we check for function but TS still complains
|
|
180
181
|
typeof curr !== 'function' ? curr : curr({ route, navigation })
|
|
181
182
|
),
|
|
182
183
|
{} as ScreenOptions
|
|
@@ -153,7 +153,12 @@ const getRouteConfigsFromChildren = <
|
|
|
153
153
|
? `'${
|
|
154
154
|
typeof child.type === 'string' ? child.type : child.type?.name
|
|
155
155
|
}'${
|
|
156
|
-
child.props
|
|
156
|
+
child.props != null &&
|
|
157
|
+
typeof child.props === 'object' &&
|
|
158
|
+
'name' in child.props &&
|
|
159
|
+
child.props?.name
|
|
160
|
+
? ` for the screen '${child.props.name}'`
|
|
161
|
+
: ''
|
|
157
162
|
}`
|
|
158
163
|
: typeof child === 'object'
|
|
159
164
|
? JSON.stringify(child)
|