@react-navigation/core 6.4.4 → 6.4.6
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/BaseNavigationContainer.js +17 -69
- package/lib/commonjs/BaseNavigationContainer.js.map +1 -1
- package/lib/commonjs/CurrentRenderContext.js +0 -4
- package/lib/commonjs/CurrentRenderContext.js.map +1 -1
- package/lib/commonjs/EnsureSingleNavigator.js +1 -12
- package/lib/commonjs/EnsureSingleNavigator.js.map +1 -1
- package/lib/commonjs/Group.js +0 -1
- package/lib/commonjs/Group.js.map +1 -1
- package/lib/commonjs/NavigationBuilderContext.js +0 -4
- package/lib/commonjs/NavigationBuilderContext.js.map +1 -1
- package/lib/commonjs/NavigationContainerRefContext.js +0 -4
- package/lib/commonjs/NavigationContainerRefContext.js.map +1 -1
- package/lib/commonjs/NavigationContext.js +0 -4
- package/lib/commonjs/NavigationContext.js.map +1 -1
- package/lib/commonjs/NavigationHelpersContext.js +0 -4
- package/lib/commonjs/NavigationHelpersContext.js.map +1 -1
- package/lib/commonjs/NavigationRouteContext.js +0 -4
- package/lib/commonjs/NavigationRouteContext.js.map +1 -1
- package/lib/commonjs/NavigationStateContext.js +0 -12
- package/lib/commonjs/NavigationStateContext.js.map +1 -1
- package/lib/commonjs/PreventRemoveContext.js +0 -4
- package/lib/commonjs/PreventRemoveContext.js.map +1 -1
- package/lib/commonjs/PreventRemoveProvider.js +3 -21
- package/lib/commonjs/PreventRemoveProvider.js.map +1 -1
- package/lib/commonjs/SceneView.js +8 -13
- package/lib/commonjs/SceneView.js.map +1 -1
- package/lib/commonjs/Screen.js +0 -1
- package/lib/commonjs/Screen.js.map +1 -1
- package/lib/commonjs/StaticContainer.js +0 -10
- package/lib/commonjs/StaticContainer.js.map +1 -1
- package/lib/commonjs/UnhandledActionContext.js +0 -4
- package/lib/commonjs/UnhandledActionContext.js.map +1 -1
- package/lib/commonjs/checkDuplicateRouteNames.js +0 -5
- package/lib/commonjs/checkDuplicateRouteNames.js.map +1 -1
- package/lib/commonjs/checkSerializable.js +0 -9
- package/lib/commonjs/checkSerializable.js.map +1 -1
- package/lib/commonjs/createNavigationContainerRef.js +0 -13
- package/lib/commonjs/createNavigationContainerRef.js.map +1 -1
- package/lib/commonjs/createNavigatorFactory.js +0 -5
- package/lib/commonjs/createNavigatorFactory.js.map +1 -1
- package/lib/commonjs/findFocusedRoute.js +5 -10
- package/lib/commonjs/findFocusedRoute.js.map +1 -1
- package/lib/commonjs/fromEntries.js +0 -3
- package/lib/commonjs/fromEntries.js.map +1 -1
- package/lib/commonjs/getActionFromState.js +11 -22
- package/lib/commonjs/getActionFromState.js.map +1 -1
- package/lib/commonjs/getFocusedRouteNameFromRoute.js +7 -8
- package/lib/commonjs/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/commonjs/getPathFromState.js +25 -55
- package/lib/commonjs/getPathFromState.js.map +1 -1
- package/lib/commonjs/getStateFromPath.js +48 -105
- package/lib/commonjs/getStateFromPath.js.map +1 -1
- package/lib/commonjs/index.js +0 -30
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/isArrayEqual.js +0 -3
- package/lib/commonjs/isArrayEqual.js.map +1 -1
- package/lib/commonjs/isRecordEqual.js +0 -4
- package/lib/commonjs/isRecordEqual.js.map +1 -1
- package/lib/commonjs/types.js +3 -5
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useChildListeners.js +0 -5
- package/lib/commonjs/useChildListeners.js.map +1 -1
- package/lib/commonjs/useComponent.js +3 -9
- package/lib/commonjs/useComponent.js.map +1 -1
- package/lib/commonjs/useCurrentRender.js +0 -7
- package/lib/commonjs/useCurrentRender.js.map +1 -1
- package/lib/commonjs/useDescriptors.js +11 -21
- package/lib/commonjs/useDescriptors.js.map +1 -1
- package/lib/commonjs/useEventEmitter.js +2 -24
- package/lib/commonjs/useEventEmitter.js.map +1 -1
- package/lib/commonjs/useFocusEffect.js +2 -20
- package/lib/commonjs/useFocusEffect.js.map +1 -1
- package/lib/commonjs/useFocusEvents.js +9 -15
- package/lib/commonjs/useFocusEvents.js.map +1 -1
- package/lib/commonjs/useFocusedListenersChildrenAdapter.js +0 -8
- package/lib/commonjs/useFocusedListenersChildrenAdapter.js.map +1 -1
- package/lib/commonjs/useIsFocused.js +0 -8
- package/lib/commonjs/useIsFocused.js.map +1 -1
- package/lib/commonjs/useKeyedChildListeners.js +0 -4
- package/lib/commonjs/useKeyedChildListeners.js.map +1 -1
- package/lib/commonjs/useNavigation.js +3 -11
- package/lib/commonjs/useNavigation.js.map +1 -1
- package/lib/commonjs/useNavigationBuilder.js +34 -91
- package/lib/commonjs/useNavigationBuilder.js.map +1 -1
- package/lib/commonjs/useNavigationCache.js +18 -30
- package/lib/commonjs/useNavigationCache.js.map +1 -1
- package/lib/commonjs/useNavigationContainerRef.js +0 -8
- package/lib/commonjs/useNavigationContainerRef.js.map +1 -1
- package/lib/commonjs/useNavigationHelpers.js +4 -18
- package/lib/commonjs/useNavigationHelpers.js.map +1 -1
- package/lib/commonjs/useNavigationState.js +5 -9
- package/lib/commonjs/useNavigationState.js.map +1 -1
- package/lib/commonjs/useOnAction.js +8 -25
- package/lib/commonjs/useOnAction.js.map +1 -1
- package/lib/commonjs/useOnGetState.js +6 -16
- package/lib/commonjs/useOnGetState.js.map +1 -1
- package/lib/commonjs/useOnPreventRemove.js +9 -24
- package/lib/commonjs/useOnPreventRemove.js.map +1 -1
- package/lib/commonjs/useOnRouteFocus.js +0 -8
- package/lib/commonjs/useOnRouteFocus.js.map +1 -1
- package/lib/commonjs/useOptionsGetters.js +5 -24
- package/lib/commonjs/useOptionsGetters.js.map +1 -1
- package/lib/commonjs/usePreventRemove.js +0 -11
- package/lib/commonjs/usePreventRemove.js.map +1 -1
- package/lib/commonjs/usePreventRemoveContext.js +0 -8
- package/lib/commonjs/usePreventRemoveContext.js.map +1 -1
- package/lib/commonjs/useRegisterNavigator.js +0 -8
- package/lib/commonjs/useRegisterNavigator.js.map +1 -1
- package/lib/commonjs/useRoute.js +0 -8
- package/lib/commonjs/useRoute.js.map +1 -1
- package/lib/commonjs/useRouteCache.js +1 -10
- package/lib/commonjs/useRouteCache.js.map +1 -1
- package/lib/commonjs/useScheduleUpdate.js +1 -8
- package/lib/commonjs/useScheduleUpdate.js.map +1 -1
- package/lib/commonjs/useSyncState.js +9 -17
- package/lib/commonjs/useSyncState.js.map +1 -1
- package/lib/commonjs/validatePathConfig.js +0 -7
- package/lib/commonjs/validatePathConfig.js.map +1 -1
- package/lib/module/BaseNavigationContainer.js +17 -46
- package/lib/module/BaseNavigationContainer.js.map +1 -1
- package/lib/module/CurrentRenderContext.js +1 -1
- package/lib/module/CurrentRenderContext.js.map +1 -1
- package/lib/module/EnsureSingleNavigator.js +1 -7
- package/lib/module/EnsureSingleNavigator.js.map +1 -1
- package/lib/module/Group.js.map +1 -1
- package/lib/module/NavigationBuilderContext.js +0 -1
- package/lib/module/NavigationBuilderContext.js.map +1 -1
- package/lib/module/NavigationContainerRefContext.js +0 -1
- package/lib/module/NavigationContainerRefContext.js.map +1 -1
- package/lib/module/NavigationContext.js +0 -1
- package/lib/module/NavigationContext.js.map +1 -1
- package/lib/module/NavigationHelpersContext.js +0 -1
- package/lib/module/NavigationHelpersContext.js.map +1 -1
- package/lib/module/NavigationRouteContext.js +1 -1
- package/lib/module/NavigationRouteContext.js.map +1 -1
- package/lib/module/NavigationStateContext.js +0 -6
- package/lib/module/NavigationStateContext.js.map +1 -1
- package/lib/module/PreventRemoveContext.js +1 -0
- package/lib/module/PreventRemoveContext.js.map +1 -1
- package/lib/module/PreventRemoveProvider.js +3 -12
- package/lib/module/PreventRemoveProvider.js.map +1 -1
- package/lib/module/SceneView.js +8 -5
- package/lib/module/SceneView.js.map +1 -1
- package/lib/module/Screen.js.map +1 -1
- package/lib/module/StaticContainer.js +1 -6
- package/lib/module/StaticContainer.js.map +1 -1
- package/lib/module/UnhandledActionContext.js.map +1 -1
- package/lib/module/checkDuplicateRouteNames.js +0 -4
- package/lib/module/checkDuplicateRouteNames.js.map +1 -1
- package/lib/module/checkSerializable.js +0 -8
- package/lib/module/checkSerializable.js.map +1 -1
- package/lib/module/createNavigationContainerRef.js +0 -10
- package/lib/module/createNavigationContainerRef.js.map +1 -1
- package/lib/module/createNavigatorFactory.js +0 -2
- package/lib/module/createNavigatorFactory.js.map +1 -1
- package/lib/module/findFocusedRoute.js +5 -9
- package/lib/module/findFocusedRoute.js.map +1 -1
- package/lib/module/fromEntries.js +0 -2
- package/lib/module/fromEntries.js.map +1 -1
- package/lib/module/getActionFromState.js +11 -21
- package/lib/module/getActionFromState.js.map +1 -1
- package/lib/module/getFocusedRouteNameFromRoute.js +7 -6
- package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/module/getPathFromState.js +25 -49
- package/lib/module/getPathFromState.js.map +1 -1
- package/lib/module/getStateFromPath.js +48 -98
- package/lib/module/getStateFromPath.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/isArrayEqual.js +0 -2
- package/lib/module/isArrayEqual.js.map +1 -1
- package/lib/module/isRecordEqual.js +0 -3
- package/lib/module/isRecordEqual.js.map +1 -1
- package/lib/module/types.js +3 -3
- package/lib/module/types.js.map +1 -1
- package/lib/module/useChildListeners.js +0 -2
- package/lib/module/useChildListeners.js.map +1 -1
- package/lib/module/useComponent.js +3 -6
- package/lib/module/useComponent.js.map +1 -1
- package/lib/module/useCurrentRender.js +0 -2
- package/lib/module/useCurrentRender.js.map +1 -1
- package/lib/module/useDescriptors.js +11 -11
- package/lib/module/useDescriptors.js.map +1 -1
- package/lib/module/useEventEmitter.js +2 -21
- package/lib/module/useEventEmitter.js.map +1 -1
- package/lib/module/useFocusEffect.js +2 -15
- package/lib/module/useFocusEffect.js.map +1 -1
- package/lib/module/useFocusEvents.js +9 -10
- package/lib/module/useFocusEvents.js.map +1 -1
- package/lib/module/useFocusedListenersChildrenAdapter.js +0 -3
- package/lib/module/useFocusedListenersChildrenAdapter.js.map +1 -1
- package/lib/module/useIsFocused.js +1 -3
- package/lib/module/useIsFocused.js.map +1 -1
- package/lib/module/useKeyedChildListeners.js +0 -1
- package/lib/module/useKeyedChildListeners.js.map +1 -1
- package/lib/module/useNavigation.js +3 -5
- package/lib/module/useNavigation.js.map +1 -1
- package/lib/module/useNavigationBuilder.js +37 -63
- package/lib/module/useNavigationBuilder.js.map +1 -1
- package/lib/module/useNavigationCache.js +18 -24
- package/lib/module/useNavigationCache.js.map +1 -1
- package/lib/module/useNavigationContainerRef.js +0 -2
- package/lib/module/useNavigationContainerRef.js.map +1 -1
- package/lib/module/useNavigationHelpers.js +4 -9
- package/lib/module/useNavigationHelpers.js.map +1 -1
- package/lib/module/useNavigationState.js +5 -4
- package/lib/module/useNavigationState.js.map +1 -1
- package/lib/module/useOnAction.js +8 -19
- package/lib/module/useOnAction.js.map +1 -1
- package/lib/module/useOnGetState.js +6 -8
- package/lib/module/useOnGetState.js.map +1 -1
- package/lib/module/useOnPreventRemove.js +9 -14
- package/lib/module/useOnPreventRemove.js.map +1 -1
- package/lib/module/useOnRouteFocus.js +0 -3
- package/lib/module/useOnRouteFocus.js.map +1 -1
- package/lib/module/useOptionsGetters.js +5 -17
- package/lib/module/useOptionsGetters.js.map +1 -1
- package/lib/module/usePreventRemove.js +1 -2
- package/lib/module/usePreventRemove.js.map +1 -1
- package/lib/module/usePreventRemoveContext.js +0 -2
- package/lib/module/usePreventRemoveContext.js.map +1 -1
- package/lib/module/useRegisterNavigator.js +1 -3
- package/lib/module/useRegisterNavigator.js.map +1 -1
- package/lib/module/useRoute.js +0 -3
- package/lib/module/useRoute.js.map +1 -1
- package/lib/module/useRouteCache.js +1 -6
- package/lib/module/useRouteCache.js.map +1 -1
- package/lib/module/useScheduleUpdate.js +1 -3
- package/lib/module/useScheduleUpdate.js.map +1 -1
- package/lib/module/useSyncState.js +9 -13
- package/lib/module/useSyncState.js.map +1 -1
- package/lib/module/validatePathConfig.js +0 -6
- package/lib/module/validatePathConfig.js.map +1 -1
- package/lib/typescript/src/BaseNavigationContainer.d.ts +1 -0
- package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -0
- package/lib/typescript/src/CurrentRenderContext.d.ts +1 -0
- package/lib/typescript/src/CurrentRenderContext.d.ts.map +1 -0
- package/lib/typescript/src/EnsureSingleNavigator.d.ts +1 -0
- package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +1 -0
- package/lib/typescript/src/Group.d.ts +1 -0
- package/lib/typescript/src/Group.d.ts.map +1 -0
- package/lib/typescript/src/NavigationBuilderContext.d.ts +1 -0
- package/lib/typescript/src/NavigationBuilderContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContainerRefContext.d.ts +1 -0
- package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationContext.d.ts +1 -0
- package/lib/typescript/src/NavigationContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationHelpersContext.d.ts +1 -0
- package/lib/typescript/src/NavigationHelpersContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationRouteContext.d.ts +1 -0
- package/lib/typescript/src/NavigationRouteContext.d.ts.map +1 -0
- package/lib/typescript/src/NavigationStateContext.d.ts +1 -0
- package/lib/typescript/src/NavigationStateContext.d.ts.map +1 -0
- package/lib/typescript/src/PreventRemoveContext.d.ts +1 -0
- package/lib/typescript/src/PreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/src/PreventRemoveProvider.d.ts +1 -0
- package/lib/typescript/src/PreventRemoveProvider.d.ts.map +1 -0
- package/lib/typescript/src/SceneView.d.ts +1 -0
- package/lib/typescript/src/SceneView.d.ts.map +1 -0
- package/lib/typescript/src/Screen.d.ts +1 -0
- package/lib/typescript/src/Screen.d.ts.map +1 -0
- package/lib/typescript/src/StaticContainer.d.ts +1 -0
- package/lib/typescript/src/StaticContainer.d.ts.map +1 -0
- package/lib/typescript/src/UnhandledActionContext.d.ts +1 -0
- package/lib/typescript/src/UnhandledActionContext.d.ts.map +1 -0
- package/lib/typescript/src/checkDuplicateRouteNames.d.ts +1 -0
- package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +1 -0
- package/lib/typescript/src/checkSerializable.d.ts +1 -0
- package/lib/typescript/src/checkSerializable.d.ts.map +1 -0
- package/lib/typescript/src/createNavigationContainerRef.d.ts +1 -0
- package/lib/typescript/src/createNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/src/createNavigatorFactory.d.ts +1 -0
- package/lib/typescript/src/createNavigatorFactory.d.ts.map +1 -0
- package/lib/typescript/src/findFocusedRoute.d.ts +1 -0
- package/lib/typescript/src/findFocusedRoute.d.ts.map +1 -0
- package/lib/typescript/src/fromEntries.d.ts +1 -0
- package/lib/typescript/src/fromEntries.d.ts.map +1 -0
- package/lib/typescript/src/getActionFromState.d.ts +1 -0
- package/lib/typescript/src/getActionFromState.d.ts.map +1 -0
- package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts +1 -0
- package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
- package/lib/typescript/src/getPathFromState.d.ts +1 -0
- package/lib/typescript/src/getPathFromState.d.ts.map +1 -0
- package/lib/typescript/src/getStateFromPath.d.ts +1 -0
- package/lib/typescript/src/getStateFromPath.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/isArrayEqual.d.ts +1 -0
- package/lib/typescript/src/isArrayEqual.d.ts.map +1 -0
- package/lib/typescript/src/isRecordEqual.d.ts +1 -0
- package/lib/typescript/src/isRecordEqual.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +1 -9
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/useChildListeners.d.ts +1 -0
- package/lib/typescript/src/useChildListeners.d.ts.map +1 -0
- package/lib/typescript/src/useComponent.d.ts +1 -0
- package/lib/typescript/src/useComponent.d.ts.map +1 -0
- package/lib/typescript/src/useCurrentRender.d.ts +1 -0
- package/lib/typescript/src/useCurrentRender.d.ts.map +1 -0
- package/lib/typescript/src/useDescriptors.d.ts +1 -0
- package/lib/typescript/src/useDescriptors.d.ts.map +1 -0
- package/lib/typescript/src/useEventEmitter.d.ts +1 -0
- package/lib/typescript/src/useEventEmitter.d.ts.map +1 -0
- package/lib/typescript/src/useFocusEffect.d.ts +1 -0
- package/lib/typescript/src/useFocusEffect.d.ts.map +1 -0
- package/lib/typescript/src/useFocusEvents.d.ts +1 -0
- package/lib/typescript/src/useFocusEvents.d.ts.map +1 -0
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts +1 -0
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
- package/lib/typescript/src/useIsFocused.d.ts +1 -0
- package/lib/typescript/src/useIsFocused.d.ts.map +1 -0
- package/lib/typescript/src/useKeyedChildListeners.d.ts +1 -0
- package/lib/typescript/src/useKeyedChildListeners.d.ts.map +1 -0
- package/lib/typescript/src/useNavigation.d.ts +1 -0
- package/lib/typescript/src/useNavigation.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationBuilder.d.ts +16 -3
- package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationCache.d.ts +1 -0
- package/lib/typescript/src/useNavigationCache.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationContainerRef.d.ts +1 -0
- package/lib/typescript/src/useNavigationContainerRef.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationHelpers.d.ts +1 -0
- package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationState.d.ts +1 -0
- package/lib/typescript/src/useNavigationState.d.ts.map +1 -0
- package/lib/typescript/src/useOnAction.d.ts +1 -0
- package/lib/typescript/src/useOnAction.d.ts.map +1 -0
- package/lib/typescript/src/useOnGetState.d.ts +1 -0
- package/lib/typescript/src/useOnGetState.d.ts.map +1 -0
- package/lib/typescript/src/useOnPreventRemove.d.ts +1 -0
- package/lib/typescript/src/useOnPreventRemove.d.ts.map +1 -0
- package/lib/typescript/src/useOnRouteFocus.d.ts +1 -0
- package/lib/typescript/src/useOnRouteFocus.d.ts.map +1 -0
- package/lib/typescript/src/useOptionsGetters.d.ts +1 -0
- package/lib/typescript/src/useOptionsGetters.d.ts.map +1 -0
- package/lib/typescript/src/usePreventRemove.d.ts +1 -0
- package/lib/typescript/src/usePreventRemove.d.ts.map +1 -0
- package/lib/typescript/src/usePreventRemoveContext.d.ts +1 -0
- package/lib/typescript/src/usePreventRemoveContext.d.ts.map +1 -0
- package/lib/typescript/src/useRegisterNavigator.d.ts +1 -0
- package/lib/typescript/src/useRegisterNavigator.d.ts.map +1 -0
- package/lib/typescript/src/useRoute.d.ts +1 -0
- package/lib/typescript/src/useRoute.d.ts.map +1 -0
- package/lib/typescript/src/useRouteCache.d.ts +1 -0
- package/lib/typescript/src/useRouteCache.d.ts.map +1 -0
- package/lib/typescript/src/useScheduleUpdate.d.ts +1 -0
- package/lib/typescript/src/useScheduleUpdate.d.ts.map +1 -0
- package/lib/typescript/src/useSyncState.d.ts +1 -0
- package/lib/typescript/src/useSyncState.d.ts.map +1 -0
- package/lib/typescript/src/validatePathConfig.d.ts +1 -0
- package/lib/typescript/src/validatePathConfig.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/types.tsx +0 -11
- package/src/useNavigationBuilder.tsx +16 -0
|
@@ -4,89 +4,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useNavigationBuilder;
|
|
7
|
-
|
|
8
7
|
var _routers = require("@react-navigation/routers");
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _reactIs = require("react-is");
|
|
13
|
-
|
|
14
10
|
var _Group = _interopRequireDefault(require("./Group"));
|
|
15
|
-
|
|
16
11
|
var _isArrayEqual = _interopRequireDefault(require("./isArrayEqual"));
|
|
17
|
-
|
|
18
12
|
var _isRecordEqual = _interopRequireDefault(require("./isRecordEqual"));
|
|
19
|
-
|
|
20
13
|
var _NavigationHelpersContext = _interopRequireDefault(require("./NavigationHelpersContext"));
|
|
21
|
-
|
|
22
14
|
var _NavigationRouteContext = _interopRequireDefault(require("./NavigationRouteContext"));
|
|
23
|
-
|
|
24
15
|
var _NavigationStateContext = _interopRequireDefault(require("./NavigationStateContext"));
|
|
25
|
-
|
|
26
16
|
var _PreventRemoveProvider = _interopRequireDefault(require("./PreventRemoveProvider"));
|
|
27
|
-
|
|
28
17
|
var _Screen = _interopRequireDefault(require("./Screen"));
|
|
29
|
-
|
|
30
18
|
var _types = require("./types");
|
|
31
|
-
|
|
32
19
|
var _useChildListeners = _interopRequireDefault(require("./useChildListeners"));
|
|
33
|
-
|
|
34
20
|
var _useComponent = _interopRequireDefault(require("./useComponent"));
|
|
35
|
-
|
|
36
21
|
var _useCurrentRender = _interopRequireDefault(require("./useCurrentRender"));
|
|
37
|
-
|
|
38
22
|
var _useDescriptors = _interopRequireDefault(require("./useDescriptors"));
|
|
39
|
-
|
|
40
23
|
var _useEventEmitter = _interopRequireDefault(require("./useEventEmitter"));
|
|
41
|
-
|
|
42
24
|
var _useFocusedListenersChildrenAdapter = _interopRequireDefault(require("./useFocusedListenersChildrenAdapter"));
|
|
43
|
-
|
|
44
25
|
var _useFocusEvents = _interopRequireDefault(require("./useFocusEvents"));
|
|
45
|
-
|
|
46
26
|
var _useKeyedChildListeners = _interopRequireDefault(require("./useKeyedChildListeners"));
|
|
47
|
-
|
|
48
27
|
var _useNavigationHelpers = _interopRequireDefault(require("./useNavigationHelpers"));
|
|
49
|
-
|
|
50
28
|
var _useOnAction = _interopRequireDefault(require("./useOnAction"));
|
|
51
|
-
|
|
52
29
|
var _useOnGetState = _interopRequireDefault(require("./useOnGetState"));
|
|
53
|
-
|
|
54
30
|
var _useOnRouteFocus = _interopRequireDefault(require("./useOnRouteFocus"));
|
|
55
|
-
|
|
56
31
|
var _useRegisterNavigator = _interopRequireDefault(require("./useRegisterNavigator"));
|
|
57
|
-
|
|
58
32
|
var _useScheduleUpdate = _interopRequireDefault(require("./useScheduleUpdate"));
|
|
59
|
-
|
|
60
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
61
|
-
|
|
62
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
63
|
-
|
|
64
35
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
65
|
-
|
|
66
36
|
// This is to make TypeScript compiler happy
|
|
67
37
|
// eslint-disable-next-line babel/no-unused-expressions
|
|
68
38
|
_types.PrivateValueStore;
|
|
69
|
-
|
|
70
39
|
const isValidKey = key => key === undefined || typeof key === 'string' && key !== '';
|
|
40
|
+
|
|
71
41
|
/**
|
|
72
42
|
* Extract route config object from React children elements.
|
|
73
43
|
*
|
|
74
44
|
* @param children React Elements to extract the config from.
|
|
75
45
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
46
|
const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
|
|
79
47
|
const configs = React.Children.toArray(children).reduce((acc, child) => {
|
|
80
48
|
var _child$type, _child$props;
|
|
81
|
-
|
|
82
49
|
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
83
50
|
if (child.type === _Screen.default) {
|
|
84
51
|
// We can only extract the config from `Screen` elements
|
|
85
52
|
// If something else was rendered, it's probably a bug
|
|
53
|
+
|
|
86
54
|
if (!isValidKey(child.props.navigationKey)) {
|
|
87
55
|
throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the screen '${child.props.name}'. It must be a non-empty string or 'undefined'.`);
|
|
88
56
|
}
|
|
89
|
-
|
|
90
57
|
acc.push({
|
|
91
58
|
keys: [groupKey, child.props.navigationKey],
|
|
92
59
|
options: groupOptions,
|
|
@@ -94,22 +61,19 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
|
|
|
94
61
|
});
|
|
95
62
|
return acc;
|
|
96
63
|
}
|
|
97
|
-
|
|
98
64
|
if (child.type === React.Fragment || child.type === _Group.default) {
|
|
99
65
|
if (!isValidKey(child.props.navigationKey)) {
|
|
100
66
|
throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the group. It must be a non-empty string or 'undefined'.`);
|
|
101
|
-
}
|
|
102
|
-
// This is handy to conditionally define a group of screens
|
|
103
|
-
|
|
67
|
+
}
|
|
104
68
|
|
|
69
|
+
// When we encounter a fragment or group, we need to dive into its children to extract the configs
|
|
70
|
+
// This is handy to conditionally define a group of screens
|
|
105
71
|
acc.push(...getRouteConfigsFromChildren(child.props.children, child.props.navigationKey, child.type !== _Group.default ? groupOptions : groupOptions != null ? [...groupOptions, child.props.screenOptions] : [child.props.screenOptions]));
|
|
106
72
|
return acc;
|
|
107
73
|
}
|
|
108
74
|
}
|
|
109
|
-
|
|
110
75
|
throw new Error(`A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${/*#__PURE__*/React.isValidElement(child) ? `'${typeof child.type === 'string' ? child.type : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name}'${(_child$props = child.props) !== null && _child$props !== void 0 && _child$props.name ? ` for the screen '${child.props.name}'` : ''}` : typeof child === 'object' ? JSON.stringify(child) : `'${String(child)}'`}). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`);
|
|
111
76
|
}, []);
|
|
112
|
-
|
|
113
77
|
if (process.env.NODE_ENV !== 'production') {
|
|
114
78
|
configs.forEach(config => {
|
|
115
79
|
const {
|
|
@@ -118,36 +82,28 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
|
|
|
118
82
|
component,
|
|
119
83
|
getComponent
|
|
120
84
|
} = config.props;
|
|
121
|
-
|
|
122
85
|
if (typeof name !== 'string' || !name) {
|
|
123
86
|
throw new Error(`Got an invalid name (${JSON.stringify(name)}) for the screen. It must be a non-empty string.`);
|
|
124
87
|
}
|
|
125
|
-
|
|
126
88
|
if (children != null || component !== undefined || getComponent !== undefined) {
|
|
127
89
|
if (children != null && component !== undefined) {
|
|
128
90
|
throw new Error(`Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`);
|
|
129
91
|
}
|
|
130
|
-
|
|
131
92
|
if (children != null && getComponent !== undefined) {
|
|
132
93
|
throw new Error(`Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`);
|
|
133
94
|
}
|
|
134
|
-
|
|
135
95
|
if (component !== undefined && getComponent !== undefined) {
|
|
136
96
|
throw new Error(`Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`);
|
|
137
97
|
}
|
|
138
|
-
|
|
139
98
|
if (children != null && typeof children !== 'function') {
|
|
140
99
|
throw new Error(`Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`);
|
|
141
100
|
}
|
|
142
|
-
|
|
143
101
|
if (component !== undefined && !(0, _reactIs.isValidElementType)(component)) {
|
|
144
102
|
throw new Error(`Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`);
|
|
145
103
|
}
|
|
146
|
-
|
|
147
104
|
if (getComponent !== undefined && typeof getComponent !== 'function') {
|
|
148
105
|
throw new Error(`Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`);
|
|
149
106
|
}
|
|
150
|
-
|
|
151
107
|
if (typeof component === 'function') {
|
|
152
108
|
if (component.name === 'component') {
|
|
153
109
|
// Inline anonymous functions passed in the `component` prop will have the name of the prop
|
|
@@ -163,9 +119,9 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
|
|
|
163
119
|
}
|
|
164
120
|
});
|
|
165
121
|
}
|
|
166
|
-
|
|
167
122
|
return configs;
|
|
168
123
|
};
|
|
124
|
+
|
|
169
125
|
/**
|
|
170
126
|
* Hook for building navigators.
|
|
171
127
|
*
|
|
@@ -173,8 +129,6 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
|
|
|
173
129
|
* @param options Options object containing `children` and additional options for the router.
|
|
174
130
|
* @returns An object containing `state`, `navigation`, `descriptors` objects.
|
|
175
131
|
*/
|
|
176
|
-
|
|
177
|
-
|
|
178
132
|
function useNavigationBuilder(createRouter, options) {
|
|
179
133
|
const navigatorKey = (0, _useRegisterNavigator.default)();
|
|
180
134
|
const route = React.useContext(_NavigationRouteContext.default);
|
|
@@ -185,7 +139,8 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
185
139
|
} = options;
|
|
186
140
|
const {
|
|
187
141
|
current: router
|
|
188
|
-
} = React.useRef(createRouter({
|
|
142
|
+
} = React.useRef(createRouter({
|
|
143
|
+
...rest,
|
|
189
144
|
...(route !== null && route !== void 0 && route.params && route.params.state == null && route.params.initial !== false && typeof route.params.screen === 'string' ? {
|
|
190
145
|
initialRouteName: route.params.screen
|
|
191
146
|
} : null)
|
|
@@ -195,13 +150,12 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
195
150
|
if (config.props.name in acc) {
|
|
196
151
|
throw new Error(`A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`);
|
|
197
152
|
}
|
|
198
|
-
|
|
199
153
|
acc[config.props.name] = config;
|
|
200
154
|
return acc;
|
|
201
155
|
}, {});
|
|
202
156
|
const routeNames = routeConfigs.map(config => config.props.name);
|
|
203
157
|
const routeKeyList = routeNames.reduce((acc, curr) => {
|
|
204
|
-
acc[curr] = screens[curr].keys.map(key => key
|
|
158
|
+
acc[curr] = screens[curr].keys.map(key => key ?? '').join(':');
|
|
205
159
|
return acc;
|
|
206
160
|
}, {});
|
|
207
161
|
const routeParamList = routeNames.reduce((acc, curr) => {
|
|
@@ -214,11 +168,9 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
214
168
|
const routeGetIdList = routeNames.reduce((acc, curr) => Object.assign(acc, {
|
|
215
169
|
[curr]: screens[curr].props.getId
|
|
216
170
|
}), {});
|
|
217
|
-
|
|
218
171
|
if (!routeNames.length) {
|
|
219
172
|
throw new Error("Couldn't find any screens for the navigator. Have you defined any screens as its children?");
|
|
220
173
|
}
|
|
221
|
-
|
|
222
174
|
const isStateValid = React.useCallback(state => state.type === undefined || state.type === router.type, [router.type]);
|
|
223
175
|
const isStateInitialized = React.useCallback(state => state !== undefined && state.stale === false && isStateValid(state), [isStateValid]);
|
|
224
176
|
const {
|
|
@@ -241,28 +193,27 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
241
193
|
// This would lead to old data preservation on main navigator unmount
|
|
242
194
|
return;
|
|
243
195
|
}
|
|
244
|
-
|
|
245
196
|
setCurrentState(state);
|
|
246
197
|
}, [setCurrentState]);
|
|
247
198
|
const [initializedState, isFirstStateInitialization] = React.useMemo(() => {
|
|
248
199
|
var _route$params4;
|
|
249
|
-
|
|
250
200
|
const initialRouteParamList = routeNames.reduce((acc, curr) => {
|
|
251
201
|
var _route$params, _route$params2, _route$params3;
|
|
252
|
-
|
|
253
202
|
const {
|
|
254
203
|
initialParams
|
|
255
204
|
} = screens[curr].props;
|
|
256
205
|
const initialParamsFromParams = (route === null || route === void 0 ? void 0 : (_route$params = route.params) === null || _route$params === void 0 ? void 0 : _route$params.state) == null && (route === null || route === void 0 ? void 0 : (_route$params2 = route.params) === null || _route$params2 === void 0 ? void 0 : _route$params2.initial) !== false && (route === null || route === void 0 ? void 0 : (_route$params3 = route.params) === null || _route$params3 === void 0 ? void 0 : _route$params3.screen) === curr ? route.params.params : undefined;
|
|
257
|
-
acc[curr] = initialParams !== undefined || initialParamsFromParams !== undefined ? {
|
|
206
|
+
acc[curr] = initialParams !== undefined || initialParamsFromParams !== undefined ? {
|
|
207
|
+
...initialParams,
|
|
258
208
|
...initialParamsFromParams
|
|
259
209
|
} : undefined;
|
|
260
210
|
return acc;
|
|
261
|
-
}, {});
|
|
211
|
+
}, {});
|
|
212
|
+
|
|
213
|
+
// If the current state isn't initialized on first render, we initialize it
|
|
262
214
|
// We also need to re-initialize it if the state passed from parent was changed (maybe due to reset)
|
|
263
215
|
// Otherwise assume that the state was provided as initial state
|
|
264
216
|
// So we need to rehydrate it to make it usable
|
|
265
|
-
|
|
266
217
|
if ((currentState === undefined || !isStateValid(currentState)) && (route === null || route === void 0 ? void 0 : (_route$params4 = route.params) === null || _route$params4 === void 0 ? void 0 : _route$params4.state) == null) {
|
|
267
218
|
return [router.getInitialState({
|
|
268
219
|
routeNames,
|
|
@@ -270,32 +221,31 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
270
221
|
routeGetIdList
|
|
271
222
|
}), true];
|
|
272
223
|
} else {
|
|
273
|
-
var _route$
|
|
274
|
-
|
|
275
|
-
return [router.getRehydratedState((_route$params$state = route === null || route === void 0 ? void 0 : (_route$params5 = route.params) === null || _route$params5 === void 0 ? void 0 : _route$params5.state) !== null && _route$params$state !== void 0 ? _route$params$state : currentState, {
|
|
224
|
+
var _route$params5;
|
|
225
|
+
return [router.getRehydratedState((route === null || route === void 0 ? void 0 : (_route$params5 = route.params) === null || _route$params5 === void 0 ? void 0 : _route$params5.state) ?? currentState, {
|
|
276
226
|
routeNames,
|
|
277
227
|
routeParamList: initialRouteParamList,
|
|
278
228
|
routeGetIdList
|
|
279
229
|
}), false];
|
|
280
|
-
}
|
|
230
|
+
}
|
|
231
|
+
// We explicitly don't include routeNames, route.params etc. in the dep list
|
|
281
232
|
// below. We want to avoid forcing a new state to be calculated in those cases
|
|
282
233
|
// Instead, we handle changes to these in the nextState code below. Note
|
|
283
234
|
// that some changes to routeConfigs are explicitly ignored, such as changes
|
|
284
235
|
// to initialParams
|
|
285
236
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
286
|
-
|
|
287
237
|
}, [currentState, router, isStateValid]);
|
|
288
238
|
const previousRouteKeyListRef = React.useRef(routeKeyList);
|
|
289
239
|
React.useEffect(() => {
|
|
290
240
|
previousRouteKeyListRef.current = routeKeyList;
|
|
291
241
|
});
|
|
292
242
|
const previousRouteKeyList = previousRouteKeyListRef.current;
|
|
293
|
-
let state =
|
|
243
|
+
let state =
|
|
244
|
+
// If the state isn't initialized, or stale, use the state we initialized instead
|
|
294
245
|
// The state won't update until there's a change needed in the state we have initalized locally
|
|
295
246
|
// So it'll be `undefined` or stale until the first navigation event happens
|
|
296
247
|
isStateInitialized(currentState) ? currentState : initializedState;
|
|
297
248
|
let nextState = state;
|
|
298
|
-
|
|
299
249
|
if (!(0, _isArrayEqual.default)(state.routeNames, routeNames) || !(0, _isRecordEqual.default)(routeKeyList, previousRouteKeyList)) {
|
|
300
250
|
// When the list of route names change, the router should handle it to remove invalid routes
|
|
301
251
|
nextState = router.getStateForRouteNamesChange(state, {
|
|
@@ -305,16 +255,13 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
305
255
|
routeKeyChanges: Object.keys(routeKeyList).filter(name => previousRouteKeyList.hasOwnProperty(name) && routeKeyList[name] !== previousRouteKeyList[name])
|
|
306
256
|
});
|
|
307
257
|
}
|
|
308
|
-
|
|
309
258
|
const previousNestedParamsRef = React.useRef(route === null || route === void 0 ? void 0 : route.params);
|
|
310
259
|
React.useEffect(() => {
|
|
311
260
|
previousNestedParamsRef.current = route === null || route === void 0 ? void 0 : route.params;
|
|
312
261
|
}, [route === null || route === void 0 ? void 0 : route.params]);
|
|
313
|
-
|
|
314
262
|
if (route !== null && route !== void 0 && route.params) {
|
|
315
263
|
const previousParams = previousNestedParamsRef.current;
|
|
316
264
|
let action;
|
|
317
|
-
|
|
318
265
|
if (typeof route.params.state === 'object' && route.params.state != null && route.params !== previousParams) {
|
|
319
266
|
// If the route was updated with new state, we should reset to it
|
|
320
267
|
action = _routers.CommonActions.reset(route.params.state);
|
|
@@ -325,9 +272,9 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
325
272
|
params: route.params.params,
|
|
326
273
|
path: route.params.path
|
|
327
274
|
});
|
|
328
|
-
}
|
|
329
|
-
|
|
275
|
+
}
|
|
330
276
|
|
|
277
|
+
// The update should be limited to current navigator only, so we call the router manually
|
|
331
278
|
const updatedState = action ? router.getStateForAction(nextState, action, {
|
|
332
279
|
routeNames,
|
|
333
280
|
routeParamList,
|
|
@@ -339,28 +286,26 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
339
286
|
routeGetIdList
|
|
340
287
|
}) : nextState;
|
|
341
288
|
}
|
|
342
|
-
|
|
343
289
|
const shouldUpdate = state !== nextState;
|
|
344
290
|
(0, _useScheduleUpdate.default)(() => {
|
|
345
291
|
if (shouldUpdate) {
|
|
346
292
|
// If the state needs to be updated, we'll schedule an update
|
|
347
293
|
setState(nextState);
|
|
348
294
|
}
|
|
349
|
-
});
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// The up-to-date state will come in next render, but we don't need to wait for it
|
|
350
298
|
// We can't use the outdated state since the screens have changed, which will cause error due to mismatched config
|
|
351
299
|
// So we override the state object we return to use the latest state as soon as possible
|
|
352
|
-
|
|
353
300
|
state = nextState;
|
|
354
301
|
React.useEffect(() => {
|
|
355
302
|
setKey(navigatorKey);
|
|
356
|
-
|
|
357
303
|
if (!getIsInitial()) {
|
|
358
304
|
// If it's not initial render, we need to update the state
|
|
359
305
|
// This will make sure that our container gets notifier of state changes due to new mounts
|
|
360
306
|
// This is necessary for proper screen tracking, URL updates etc.
|
|
361
307
|
setState(nextState);
|
|
362
308
|
}
|
|
363
|
-
|
|
364
309
|
return () => {
|
|
365
310
|
// We need to clean up state for this navigator on unmount
|
|
366
311
|
// We do it in a timeout because we need to detect if another navigator mounted in the meantime
|
|
@@ -371,11 +316,13 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
371
316
|
cleanUpState();
|
|
372
317
|
}
|
|
373
318
|
}, 0);
|
|
374
|
-
};
|
|
375
|
-
|
|
319
|
+
};
|
|
320
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
321
|
+
}, []);
|
|
322
|
+
|
|
323
|
+
// We initialize this ref here to avoid a new getState getting initialized
|
|
376
324
|
// whenever initializedState changes. We want getState to have access to the
|
|
377
325
|
// latest initializedState, but don't need it to change when that happens
|
|
378
|
-
|
|
379
326
|
const initializedStateRef = React.useRef();
|
|
380
327
|
initializedStateRef.current = initializedState;
|
|
381
328
|
const getState = React.useCallback(() => {
|
|
@@ -385,12 +332,9 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
385
332
|
const emitter = (0, _useEventEmitter.default)(e => {
|
|
386
333
|
let routeNames = [];
|
|
387
334
|
let route;
|
|
388
|
-
|
|
389
335
|
if (e.target) {
|
|
390
336
|
var _route;
|
|
391
|
-
|
|
392
337
|
route = state.routes.find(route => route.key === e.target);
|
|
393
|
-
|
|
394
338
|
if ((_route = route) !== null && _route !== void 0 && _route.name) {
|
|
395
339
|
routeNames.push(route.name);
|
|
396
340
|
}
|
|
@@ -398,17 +342,15 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
398
342
|
route = state.routes[state.index];
|
|
399
343
|
routeNames.push(...Object.keys(screens).filter(name => {
|
|
400
344
|
var _route2;
|
|
401
|
-
|
|
402
345
|
return ((_route2 = route) === null || _route2 === void 0 ? void 0 : _route2.name) === name;
|
|
403
346
|
}));
|
|
404
347
|
}
|
|
405
|
-
|
|
406
348
|
if (route == null) {
|
|
407
349
|
return;
|
|
408
350
|
}
|
|
409
|
-
|
|
410
351
|
const navigation = descriptors[route.key].navigation;
|
|
411
|
-
const listeners = [].concat(
|
|
352
|
+
const listeners = [].concat(
|
|
353
|
+
// Get an array of listeners for all screens + common listeners on navigator
|
|
412
354
|
...[screenListeners, ...routeNames.map(name => {
|
|
413
355
|
const {
|
|
414
356
|
listeners
|
|
@@ -420,7 +362,8 @@ function useNavigationBuilder(createRouter, options) {
|
|
|
420
362
|
navigation
|
|
421
363
|
}) : listeners;
|
|
422
364
|
return map ? Object.keys(map).filter(type => type === e.type).map(type => map === null || map === void 0 ? void 0 : map[type]) : undefined;
|
|
423
|
-
}))
|
|
365
|
+
}))
|
|
366
|
+
// We don't want same listener to be called multiple times for same event
|
|
424
367
|
// So we remove any duplicate functions from the array
|
|
425
368
|
.filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);
|
|
426
369
|
listeners.forEach(listener => listener === null || listener === void 0 ? void 0 : listener(e));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PrivateValueStore","isValidKey","key","undefined","getRouteConfigsFromChildren","children","groupKey","groupOptions","configs","React","Children","toArray","reduce","acc","child","isValidElement","type","Screen","props","navigationKey","Error","JSON","stringify","name","push","keys","options","Fragment","Group","screenOptions","String","process","env","NODE_ENV","forEach","config","component","getComponent","isValidElementType","console","warn","test","useNavigationBuilder","createRouter","navigatorKey","useRegisterNavigator","route","useContext","NavigationRouteContext","screenListeners","rest","current","router","useRef","params","state","initial","screen","initialRouteName","routeConfigs","screens","routeNames","map","routeKeyList","curr","join","routeParamList","initialParams","routeGetIdList","Object","assign","getId","length","isStateValid","useCallback","isStateInitialized","stale","currentState","getState","getCurrentState","setState","setCurrentState","setKey","getKey","getIsInitial","NavigationStateContext","stateCleanedUp","cleanUpState","initializedState","isFirstStateInitialization","useMemo","initialRouteParamList","initialParamsFromParams","getInitialState","getRehydratedState","previousRouteKeyListRef","useEffect","previousRouteKeyList","nextState","isArrayEqual","isRecordEqual","getStateForRouteNamesChange","routeKeyChanges","filter","hasOwnProperty","previousNestedParamsRef","previousParams","action","CommonActions","reset","navigate","path","updatedState","getStateForAction","shouldUpdate","useScheduleUpdate","setTimeout","initializedStateRef","emitter","useEventEmitter","e","target","routes","find","index","navigation","descriptors","listeners","concat","cb","i","self","lastIndexOf","listener","useFocusEvents","emit","data","childListeners","addListener","useChildListeners","keyedListeners","addKeyedListener","useKeyedChildListeners","onAction","useOnAction","actionListeners","beforeRemoveListeners","beforeRemove","routerConfigOptions","onRouteFocus","useOnRouteFocus","useNavigationHelpers","id","useFocusedListenersChildrenAdapter","focusedListeners","focus","useOnGetState","getStateListeners","useDescriptors","defaultScreenOptions","useCurrentRender","NavigationContent","useComponent"],"sources":["useNavigationBuilder.tsx"],"sourcesContent":["import {\n CommonActions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationState,\n ParamListBase,\n PartialState,\n Route,\n Router,\n RouterConfigOptions,\n RouterFactory,\n} from '@react-navigation/routers';\nimport * as React from 'react';\nimport { isValidElementType } from 'react-is';\n\nimport Group from './Group';\nimport isArrayEqual from './isArrayEqual';\nimport isRecordEqual from './isRecordEqual';\nimport NavigationHelpersContext from './NavigationHelpersContext';\nimport NavigationRouteContext from './NavigationRouteContext';\nimport NavigationStateContext from './NavigationStateContext';\nimport PreventRemoveProvider from './PreventRemoveProvider';\nimport Screen from './Screen';\nimport {\n DefaultNavigatorOptions,\n EventMapBase,\n EventMapCore,\n NavigatorScreenParams,\n PrivateValueStore,\n RouteConfig,\n} from './types';\nimport useChildListeners from './useChildListeners';\nimport useComponent from './useComponent';\nimport useCurrentRender from './useCurrentRender';\nimport useDescriptors, { ScreenConfigWithParent } from './useDescriptors';\nimport useEventEmitter from './useEventEmitter';\nimport useFocusedListenersChildrenAdapter from './useFocusedListenersChildrenAdapter';\nimport useFocusEvents from './useFocusEvents';\nimport useKeyedChildListeners from './useKeyedChildListeners';\nimport useNavigationHelpers from './useNavigationHelpers';\nimport useOnAction from './useOnAction';\nimport useOnGetState from './useOnGetState';\nimport useOnRouteFocus from './useOnRouteFocus';\nimport useRegisterNavigator from './useRegisterNavigator';\nimport useScheduleUpdate from './useScheduleUpdate';\n\n// This is to make TypeScript compiler happy\n// eslint-disable-next-line babel/no-unused-expressions\nPrivateValueStore;\n\ntype NavigatorRoute<State extends NavigationState> = {\n key: string;\n params?: NavigatorScreenParams<ParamListBase, State>;\n};\n\nconst isValidKey = (key: unknown) =>\n key === undefined || (typeof key === 'string' && key !== '');\n\n/**\n * Extract route config object from React children elements.\n *\n * @param children React Elements to extract the config from.\n */\nconst getRouteConfigsFromChildren = <\n State extends NavigationState,\n ScreenOptions extends {},\n EventMap extends EventMapBase\n>(\n children: React.ReactNode,\n groupKey?: string,\n groupOptions?: ScreenConfigWithParent<\n State,\n ScreenOptions,\n EventMap\n >['options']\n) => {\n const configs = React.Children.toArray(children).reduce<\n ScreenConfigWithParent<State, ScreenOptions, EventMap>[]\n >((acc, child) => {\n if (React.isValidElement(child)) {\n if (child.type === Screen) {\n // We can only extract the config from `Screen` elements\n // If something else was rendered, it's probably a bug\n\n if (!isValidKey(child.props.navigationKey)) {\n throw new Error(\n `Got an invalid 'navigationKey' prop (${JSON.stringify(\n child.props.navigationKey\n )}) for the screen '${\n child.props.name\n }'. It must be a non-empty string or 'undefined'.`\n );\n }\n\n acc.push({\n keys: [groupKey, child.props.navigationKey],\n options: groupOptions,\n props: child.props as RouteConfig<\n ParamListBase,\n string,\n State,\n ScreenOptions,\n EventMap\n >,\n });\n return acc;\n }\n\n if (child.type === React.Fragment || child.type === Group) {\n if (!isValidKey(child.props.navigationKey)) {\n throw new Error(\n `Got an invalid 'navigationKey' prop (${JSON.stringify(\n child.props.navigationKey\n )}) for the group. It must be a non-empty string or 'undefined'.`\n );\n }\n\n // When we encounter a fragment or group, we need to dive into its children to extract the configs\n // This is handy to conditionally define a group of screens\n acc.push(\n ...getRouteConfigsFromChildren<State, ScreenOptions, EventMap>(\n child.props.children,\n child.props.navigationKey,\n child.type !== Group\n ? groupOptions\n : groupOptions != null\n ? [...groupOptions, child.props.screenOptions]\n : [child.props.screenOptions]\n )\n );\n return acc;\n }\n }\n\n throw new Error(\n `A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${\n React.isValidElement(child)\n ? `'${\n typeof child.type === 'string' ? child.type : child.type?.name\n }'${\n child.props?.name ? ` for the screen '${child.props.name}'` : ''\n }`\n : typeof child === 'object'\n ? JSON.stringify(child)\n : `'${String(child)}'`\n }). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`\n );\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n configs.forEach((config) => {\n const { name, children, component, getComponent } = config.props;\n\n if (typeof name !== 'string' || !name) {\n throw new Error(\n `Got an invalid name (${JSON.stringify(\n name\n )}) for the screen. It must be a non-empty string.`\n );\n }\n\n if (\n children != null ||\n component !== undefined ||\n getComponent !== undefined\n ) {\n if (children != null && component !== undefined) {\n throw new Error(\n `Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (children != null && getComponent !== undefined) {\n throw new Error(\n `Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (component !== undefined && getComponent !== undefined) {\n throw new Error(\n `Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (children != null && typeof children !== 'function') {\n throw new Error(\n `Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`\n );\n }\n\n if (component !== undefined && !isValidElementType(component)) {\n throw new Error(\n `Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`\n );\n }\n\n if (getComponent !== undefined && typeof getComponent !== 'function') {\n throw new Error(\n `Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`\n );\n }\n\n if (typeof component === 'function') {\n if (component.name === 'component') {\n // Inline anonymous functions passed in the `component` prop will have the name of the prop\n // It's relatively safe to assume that it's not a component since it should also have PascalCase name\n // We won't catch all scenarios here, but this should catch a good chunk of incorrect use.\n console.warn(\n `Looks like you're passing an inline function for 'component' prop for the screen '${name}' (e.g. component={() => <SomeComponent />}). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour.`\n );\n } else if (/^[a-z]/.test(component.name)) {\n console.warn(\n `Got a component with the name '${component.name}' for the screen '${name}'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.`\n );\n }\n }\n } else {\n throw new Error(\n `Couldn't find a 'component', 'getComponent' or 'children' prop for the screen '${name}'. This can happen if you passed 'undefined'. You likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing.`\n );\n }\n });\n }\n\n return configs;\n};\n\n/**\n * Hook for building navigators.\n *\n * @param createRouter Factory method which returns router object.\n * @param options Options object containing `children` and additional options for the router.\n * @returns An object containing `state`, `navigation`, `descriptors` objects.\n */\nexport default function useNavigationBuilder<\n State extends NavigationState,\n RouterOptions extends DefaultRouterOptions,\n ActionHelpers extends Record<string, () => void>,\n ScreenOptions extends {},\n EventMap extends Record<string, any>\n>(\n createRouter: RouterFactory<State, any, RouterOptions>,\n options: DefaultNavigatorOptions<\n ParamListBase,\n State,\n ScreenOptions,\n EventMap\n > &\n RouterOptions\n) {\n const navigatorKey = useRegisterNavigator();\n\n const route = React.useContext(NavigationRouteContext) as\n | NavigatorRoute<State>\n | undefined;\n\n const { children, screenListeners, ...rest } = options;\n const { current: router } = React.useRef<Router<State, any>>(\n createRouter({\n ...(rest as unknown as RouterOptions),\n ...(route?.params &&\n route.params.state == null &&\n route.params.initial !== false &&\n typeof route.params.screen === 'string'\n ? { initialRouteName: route.params.screen }\n : null),\n })\n );\n\n const routeConfigs = getRouteConfigsFromChildren<\n State,\n ScreenOptions,\n EventMap\n >(children);\n\n const screens = routeConfigs.reduce<\n Record<string, ScreenConfigWithParent<State, ScreenOptions, EventMap>>\n >((acc, config) => {\n if (config.props.name in acc) {\n throw new Error(\n `A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`\n );\n }\n\n acc[config.props.name] = config;\n return acc;\n }, {});\n\n const routeNames = routeConfigs.map((config) => config.props.name);\n const routeKeyList = routeNames.reduce<Record<string, React.Key | undefined>>(\n (acc, curr) => {\n acc[curr] = screens[curr].keys.map((key) => key ?? '').join(':');\n return acc;\n },\n {}\n );\n const routeParamList = routeNames.reduce<Record<string, object | undefined>>(\n (acc, curr) => {\n const { initialParams } = screens[curr].props;\n acc[curr] = initialParams;\n return acc;\n },\n {}\n );\n const routeGetIdList = routeNames.reduce<\n RouterConfigOptions['routeGetIdList']\n >(\n (acc, curr) =>\n Object.assign(acc, {\n [curr]: screens[curr].props.getId,\n }),\n {}\n );\n\n if (!routeNames.length) {\n throw new Error(\n \"Couldn't find any screens for the navigator. Have you defined any screens as its children?\"\n );\n }\n\n const isStateValid = React.useCallback(\n (state: NavigationState | PartialState<NavigationState>) =>\n state.type === undefined || state.type === router.type,\n [router.type]\n );\n\n const isStateInitialized = React.useCallback(\n (state: NavigationState | PartialState<NavigationState> | undefined) =>\n state !== undefined && state.stale === false && isStateValid(state),\n [isStateValid]\n );\n\n const {\n state: currentState,\n getState: getCurrentState,\n setState: setCurrentState,\n setKey,\n getKey,\n getIsInitial,\n } = React.useContext(NavigationStateContext);\n\n const stateCleanedUp = React.useRef(false);\n\n const cleanUpState = React.useCallback(() => {\n setCurrentState(undefined);\n stateCleanedUp.current = true;\n }, [setCurrentState]);\n\n const setState = React.useCallback(\n (state: NavigationState | PartialState<NavigationState> | undefined) => {\n if (stateCleanedUp.current) {\n // State might have been already cleaned up due to unmount\n // We do not want to expose API allowing to override this\n // This would lead to old data preservation on main navigator unmount\n return;\n }\n setCurrentState(state);\n },\n [setCurrentState]\n );\n\n const [initializedState, isFirstStateInitialization] = React.useMemo(() => {\n const initialRouteParamList = routeNames.reduce<\n Record<string, object | undefined>\n >((acc, curr) => {\n const { initialParams } = screens[curr].props;\n const initialParamsFromParams =\n route?.params?.state == null &&\n route?.params?.initial !== false &&\n route?.params?.screen === curr\n ? route.params.params\n : undefined;\n\n acc[curr] =\n initialParams !== undefined || initialParamsFromParams !== undefined\n ? {\n ...initialParams,\n ...initialParamsFromParams,\n }\n : undefined;\n\n return acc;\n }, {});\n\n // If the current state isn't initialized on first render, we initialize it\n // We also need to re-initialize it if the state passed from parent was changed (maybe due to reset)\n // Otherwise assume that the state was provided as initial state\n // So we need to rehydrate it to make it usable\n if (\n (currentState === undefined || !isStateValid(currentState)) &&\n route?.params?.state == null\n ) {\n return [\n router.getInitialState({\n routeNames,\n routeParamList: initialRouteParamList,\n routeGetIdList,\n }),\n true,\n ];\n } else {\n return [\n router.getRehydratedState(\n route?.params?.state ?? (currentState as PartialState<State>),\n {\n routeNames,\n routeParamList: initialRouteParamList,\n routeGetIdList,\n }\n ),\n false,\n ];\n }\n // We explicitly don't include routeNames, route.params etc. in the dep list\n // below. We want to avoid forcing a new state to be calculated in those cases\n // Instead, we handle changes to these in the nextState code below. Note\n // that some changes to routeConfigs are explicitly ignored, such as changes\n // to initialParams\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentState, router, isStateValid]);\n\n const previousRouteKeyListRef = React.useRef(routeKeyList);\n\n React.useEffect(() => {\n previousRouteKeyListRef.current = routeKeyList;\n });\n\n const previousRouteKeyList = previousRouteKeyListRef.current;\n\n let state =\n // If the state isn't initialized, or stale, use the state we initialized instead\n // The state won't update until there's a change needed in the state we have initalized locally\n // So it'll be `undefined` or stale until the first navigation event happens\n isStateInitialized(currentState)\n ? (currentState as State)\n : (initializedState as State);\n\n let nextState: State = state;\n\n if (\n !isArrayEqual(state.routeNames, routeNames) ||\n !isRecordEqual(routeKeyList, previousRouteKeyList)\n ) {\n // When the list of route names change, the router should handle it to remove invalid routes\n nextState = router.getStateForRouteNamesChange(state, {\n routeNames,\n routeParamList,\n routeGetIdList,\n routeKeyChanges: Object.keys(routeKeyList).filter(\n (name) =>\n previousRouteKeyList.hasOwnProperty(name) &&\n routeKeyList[name] !== previousRouteKeyList[name]\n ),\n });\n }\n\n const previousNestedParamsRef = React.useRef(route?.params);\n\n React.useEffect(() => {\n previousNestedParamsRef.current = route?.params;\n }, [route?.params]);\n\n if (route?.params) {\n const previousParams = previousNestedParamsRef.current;\n\n let action: CommonActions.Action | undefined;\n\n if (\n typeof route.params.state === 'object' &&\n route.params.state != null &&\n route.params !== previousParams\n ) {\n // If the route was updated with new state, we should reset to it\n action = CommonActions.reset(route.params.state);\n } else if (\n typeof route.params.screen === 'string' &&\n ((route.params.initial === false && isFirstStateInitialization) ||\n route.params !== previousParams)\n ) {\n // If the route was updated with new screen name and/or params, we should navigate there\n action = CommonActions.navigate({\n name: route.params.screen,\n params: route.params.params,\n path: route.params.path,\n });\n }\n\n // The update should be limited to current navigator only, so we call the router manually\n const updatedState = action\n ? router.getStateForAction(nextState, action, {\n routeNames,\n routeParamList,\n routeGetIdList,\n })\n : null;\n\n nextState =\n updatedState !== null\n ? router.getRehydratedState(updatedState, {\n routeNames,\n routeParamList,\n routeGetIdList,\n })\n : nextState;\n }\n\n const shouldUpdate = state !== nextState;\n\n useScheduleUpdate(() => {\n if (shouldUpdate) {\n // If the state needs to be updated, we'll schedule an update\n setState(nextState);\n }\n });\n\n // The up-to-date state will come in next render, but we don't need to wait for it\n // We can't use the outdated state since the screens have changed, which will cause error due to mismatched config\n // So we override the state object we return to use the latest state as soon as possible\n state = nextState;\n\n React.useEffect(() => {\n setKey(navigatorKey);\n\n if (!getIsInitial()) {\n // If it's not initial render, we need to update the state\n // This will make sure that our container gets notifier of state changes due to new mounts\n // This is necessary for proper screen tracking, URL updates etc.\n setState(nextState);\n }\n\n return () => {\n // We need to clean up state for this navigator on unmount\n // We do it in a timeout because we need to detect if another navigator mounted in the meantime\n // For example, if another navigator has started rendering, we should skip cleanup\n // Otherwise, our cleanup step will cleanup state for the other navigator and re-initialize it\n setTimeout(() => {\n if (getCurrentState() !== undefined && getKey() === navigatorKey) {\n cleanUpState();\n }\n }, 0);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // We initialize this ref here to avoid a new getState getting initialized\n // whenever initializedState changes. We want getState to have access to the\n // latest initializedState, but don't need it to change when that happens\n const initializedStateRef = React.useRef<State>();\n initializedStateRef.current = initializedState;\n\n const getState = React.useCallback((): State => {\n const currentState = getCurrentState();\n\n return isStateInitialized(currentState)\n ? (currentState as State)\n : (initializedStateRef.current as State);\n }, [getCurrentState, isStateInitialized]);\n\n const emitter = useEventEmitter<EventMapCore<State>>((e) => {\n let routeNames = [];\n\n let route: Route<string> | undefined;\n\n if (e.target) {\n route = state.routes.find((route) => route.key === e.target);\n\n if (route?.name) {\n routeNames.push(route.name);\n }\n } else {\n route = state.routes[state.index];\n routeNames.push(\n ...Object.keys(screens).filter((name) => route?.name === name)\n );\n }\n\n if (route == null) {\n return;\n }\n\n const navigation = descriptors[route.key].navigation;\n\n const listeners = ([] as (((e: any) => void) | undefined)[])\n .concat(\n // Get an array of listeners for all screens + common listeners on navigator\n ...[\n screenListeners,\n ...routeNames.map((name) => {\n const { listeners } = screens[name].props;\n return listeners;\n }),\n ].map((listeners) => {\n const map =\n typeof listeners === 'function'\n ? listeners({ route: route as any, navigation })\n : listeners;\n\n return map\n ? Object.keys(map)\n .filter((type) => type === e.type)\n .map((type) => map?.[type])\n : undefined;\n })\n )\n // We don't want same listener to be called multiple times for same event\n // So we remove any duplicate functions from the array\n .filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);\n\n listeners.forEach((listener) => listener?.(e));\n });\n\n useFocusEvents({ state, emitter });\n\n React.useEffect(() => {\n emitter.emit({ type: 'state', data: { state } });\n }, [emitter, state]);\n\n const { listeners: childListeners, addListener } = useChildListeners();\n\n const { keyedListeners, addKeyedListener } = useKeyedChildListeners();\n\n const onAction = useOnAction({\n router,\n getState,\n setState,\n key: route?.key,\n actionListeners: childListeners.action,\n beforeRemoveListeners: keyedListeners.beforeRemove,\n routerConfigOptions: {\n routeNames,\n routeParamList,\n routeGetIdList,\n },\n emitter,\n });\n\n const onRouteFocus = useOnRouteFocus({\n router,\n key: route?.key,\n getState,\n setState,\n });\n\n const navigation = useNavigationHelpers<\n State,\n ActionHelpers,\n NavigationAction,\n EventMap\n >({\n id: options.id,\n onAction,\n getState,\n emitter,\n router,\n });\n\n useFocusedListenersChildrenAdapter({\n navigation,\n focusedListeners: childListeners.focus,\n });\n\n useOnGetState({\n getState,\n getStateListeners: keyedListeners.getState,\n });\n\n const descriptors = useDescriptors<\n State,\n ActionHelpers,\n ScreenOptions,\n EventMap\n >({\n state,\n screens,\n navigation,\n screenOptions: options.screenOptions,\n defaultScreenOptions: options.defaultScreenOptions,\n onAction,\n getState,\n setState,\n onRouteFocus,\n addListener,\n addKeyedListener,\n router,\n // @ts-expect-error: this should have both core and custom events, but too much work right now\n emitter,\n });\n\n useCurrentRender({\n state,\n navigation,\n descriptors,\n });\n\n const NavigationContent = useComponent((children: React.ReactNode) => (\n <NavigationHelpersContext.Provider value={navigation}>\n <PreventRemoveProvider>{children}</PreventRemoveProvider>\n </NavigationHelpersContext.Provider>\n ));\n\n return {\n state,\n navigation,\n descriptors,\n NavigationContent,\n };\n}\n"],"mappings":";;;;;;;AAAA;;AAYA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA;AACA;AACAA,wBAAA;;AAOA,MAAMC,UAAU,GAAIC,GAAD,IACjBA,GAAG,KAAKC,SAAR,IAAsB,OAAOD,GAAP,KAAe,QAAf,IAA2BA,GAAG,KAAK,EAD3D;AAGA;AACA;AACA;AACA;AACA;;;AACA,MAAME,2BAA2B,GAAG,CAKlCC,QALkC,EAMlCC,QANkC,EAOlCC,YAPkC,KAY/B;EACH,MAAMC,OAAO,GAAGC,KAAK,CAACC,QAAN,CAAeC,O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OAJA;IAKAlE;EALA,CALiB,CAAnB;EAaA,IAAAqG,2CAAA,EAAmC;IACjC5B,UADiC;IAEjC6B,gBAAgB,EAAEjB,cAAc,CAACkB;EAFA,CAAnC;EAKA,IAAAC,sBAAA,EAAc;IACZ9E,QADY;IAEZ+E,iBAAiB,EAAEjB,cAAc,CAAC9D;EAFtB,CAAd;EAKA,MAAMgD,WAAW,GAAG,IAAAgC,uBAAA,EAKlB;IACAvG,KADA;IAEAK,OAFA;IAGAiE,UAHA;IAIAhG,aAAa,EAAEH,OAAO,CAACG,aAJvB;IAKAkI,oBAAoB,EAAErI,OAAO,CAACqI,oBAL9B;IAMAhB,QANA;IAOAjE,QAPA;IAQAE,QARA;IASAqE,YATA;IAUAX,WAVA;IAWAG,gBAXA;IAYAzF,MAZA;IAaA;IACAkE;EAdA,CALkB,CAApB;EAsBA,IAAA0C,yBAAA,EAAiB;IACfzG,KADe;IAEfsE,UAFe;IAGfC;EAHe,CAAjB;EAMA,MAAMmC,iBAAiB,GAAG,IAAAC,qBAAA,EAAc7J,QAAD,iBACrC,oBAAC,iCAAD,CAA0B,QAA1B;IAAmC,KAAK,EAAEwH;EAA1C,gBACE,oBAAC,8BAAD,QAAwBxH,QAAxB,CADF,CADwB,CAA1B;EAMA,OAAO;IACLkD,KADK;IAELsE,UAFK;IAGLC,WAHK;IAILmC;EAJK,CAAP;AAMD"}
|
|
1
|
+
{"version":3,"names":["PrivateValueStore","isValidKey","key","undefined","getRouteConfigsFromChildren","children","groupKey","groupOptions","configs","React","Children","toArray","reduce","acc","child","isValidElement","type","Screen","props","navigationKey","Error","JSON","stringify","name","push","keys","options","Fragment","Group","screenOptions","String","process","env","NODE_ENV","forEach","config","component","getComponent","isValidElementType","console","warn","test","useNavigationBuilder","createRouter","navigatorKey","useRegisterNavigator","route","useContext","NavigationRouteContext","screenListeners","rest","current","router","useRef","params","state","initial","screen","initialRouteName","routeConfigs","screens","routeNames","map","routeKeyList","curr","join","routeParamList","initialParams","routeGetIdList","Object","assign","getId","length","isStateValid","useCallback","isStateInitialized","stale","currentState","getState","getCurrentState","setState","setCurrentState","setKey","getKey","getIsInitial","NavigationStateContext","stateCleanedUp","cleanUpState","initializedState","isFirstStateInitialization","useMemo","initialRouteParamList","initialParamsFromParams","getInitialState","getRehydratedState","previousRouteKeyListRef","useEffect","previousRouteKeyList","nextState","isArrayEqual","isRecordEqual","getStateForRouteNamesChange","routeKeyChanges","filter","hasOwnProperty","previousNestedParamsRef","previousParams","action","CommonActions","reset","navigate","path","updatedState","getStateForAction","shouldUpdate","useScheduleUpdate","setTimeout","initializedStateRef","emitter","useEventEmitter","e","target","routes","find","index","navigation","descriptors","listeners","concat","cb","i","self","lastIndexOf","listener","useFocusEvents","emit","data","childListeners","addListener","useChildListeners","keyedListeners","addKeyedListener","useKeyedChildListeners","onAction","useOnAction","actionListeners","beforeRemoveListeners","beforeRemove","routerConfigOptions","onRouteFocus","useOnRouteFocus","useNavigationHelpers","id","useFocusedListenersChildrenAdapter","focusedListeners","focus","useOnGetState","getStateListeners","useDescriptors","defaultScreenOptions","useCurrentRender","NavigationContent","useComponent"],"sourceRoot":"../../src","sources":["useNavigationBuilder.tsx"],"mappings":";;;;;;AAAA;AAYA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAoD;AAAA;AAAA;AAEpD;AACA;AACAA,wBAAiB;AAqBjB,MAAMC,UAAU,GAAIC,GAAY,IAC9BA,GAAG,KAAKC,SAAS,IAAK,OAAOD,GAAG,KAAK,QAAQ,IAAIA,GAAG,KAAK,EAAG;;AAE9D;AACA;AACA;AACA;AACA;AACA,MAAME,2BAA2B,GAAG,CAKlCC,QAAyB,EACzBC,QAAiB,EACjBC,YAIY,KACT;EACH,MAAMC,OAAO,GAAGC,KAAK,CAACC,QAAQ,CAACC,OAAO,CAACN,QAAQ,CAAC,CAACO,MAAM,CAErD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