@react-navigation/core 7.0.0-alpha.0 → 7.0.0-alpha.2
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 +35 -36
- package/lib/commonjs/BaseNavigationContainer.js.map +1 -1
- package/lib/commonjs/CurrentRenderContext.js +2 -3
- package/lib/commonjs/CurrentRenderContext.js.map +1 -1
- package/lib/commonjs/DeprecatedNavigationInChildContext.js +2 -3
- package/lib/commonjs/DeprecatedNavigationInChildContext.js.map +1 -1
- package/lib/commonjs/EnsureSingleNavigator.js +1 -1
- package/lib/commonjs/EnsureSingleNavigator.js.map +1 -1
- package/lib/commonjs/Group.js +1 -1
- package/lib/commonjs/Group.js.map +1 -1
- package/lib/commonjs/NavigationBuilderContext.js +2 -3
- package/lib/commonjs/NavigationBuilderContext.js.map +1 -1
- package/lib/commonjs/NavigationContainerRefContext.js +2 -3
- package/lib/commonjs/NavigationContainerRefContext.js.map +1 -1
- package/lib/commonjs/NavigationContext.js +2 -3
- package/lib/commonjs/NavigationContext.js.map +1 -1
- package/lib/commonjs/NavigationHelpersContext.js +2 -3
- package/lib/commonjs/NavigationHelpersContext.js.map +1 -1
- package/lib/commonjs/NavigationIndependentTree.js +7 -8
- package/lib/commonjs/NavigationIndependentTree.js.map +1 -1
- package/lib/commonjs/NavigationIndependentTreeContext.js +2 -3
- package/lib/commonjs/NavigationIndependentTreeContext.js.map +1 -1
- package/lib/commonjs/NavigationRouteContext.js +2 -3
- package/lib/commonjs/NavigationRouteContext.js.map +1 -1
- package/lib/commonjs/NavigationStateContext.js +3 -3
- package/lib/commonjs/NavigationStateContext.js.map +1 -1
- package/lib/commonjs/PreventRemoveContext.js +2 -3
- package/lib/commonjs/PreventRemoveContext.js.map +1 -1
- package/lib/commonjs/PreventRemoveProvider.js +8 -8
- package/lib/commonjs/PreventRemoveProvider.js.map +1 -1
- package/lib/commonjs/SceneView.js +8 -9
- package/lib/commonjs/SceneView.js.map +1 -1
- package/lib/commonjs/Screen.js +1 -1
- package/lib/commonjs/Screen.js.map +1 -1
- package/lib/commonjs/StaticContainer.js +4 -5
- package/lib/commonjs/StaticContainer.js.map +1 -1
- package/lib/commonjs/StaticNavigation.js +3 -5
- package/lib/commonjs/StaticNavigation.js.map +1 -1
- package/lib/commonjs/UnhandledActionContext.js +2 -3
- package/lib/commonjs/UnhandledActionContext.js.map +1 -1
- package/lib/commonjs/checkDuplicateRouteNames.js +1 -1
- package/lib/commonjs/checkDuplicateRouteNames.js.map +1 -1
- package/lib/commonjs/checkSerializable.js +1 -1
- package/lib/commonjs/checkSerializable.js.map +1 -1
- package/lib/commonjs/createNavigationContainerRef.js +1 -1
- package/lib/commonjs/createNavigationContainerRef.js.map +1 -1
- package/lib/commonjs/createNavigatorFactory.js +7 -8
- package/lib/commonjs/createNavigatorFactory.js.map +1 -1
- package/lib/commonjs/findFocusedRoute.js +1 -1
- package/lib/commonjs/findFocusedRoute.js.map +1 -1
- package/lib/commonjs/getActionFromState.js +1 -1
- package/lib/commonjs/getActionFromState.js.map +1 -1
- package/lib/commonjs/getFocusedRouteNameFromRoute.js +1 -1
- package/lib/commonjs/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/commonjs/getPathFromState.js +10 -7
- package/lib/commonjs/getPathFromState.js.map +1 -1
- package/lib/commonjs/getStateFromPath.js +20 -5
- package/lib/commonjs/getStateFromPath.js.map +1 -1
- package/lib/commonjs/index.js +56 -78
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/isArrayEqual.js +1 -1
- package/lib/commonjs/isArrayEqual.js.map +1 -1
- package/lib/commonjs/isRecordEqual.js +1 -1
- package/lib/commonjs/isRecordEqual.js.map +1 -1
- package/lib/commonjs/types.js +1 -8
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useChildListeners.js +1 -1
- package/lib/commonjs/useChildListeners.js.map +1 -1
- package/lib/commonjs/useComponent.js +1 -1
- package/lib/commonjs/useComponent.js.map +1 -1
- package/lib/commonjs/useCurrentRender.js +3 -4
- package/lib/commonjs/useCurrentRender.js.map +1 -1
- package/lib/commonjs/useDescriptors.js +14 -15
- package/lib/commonjs/useDescriptors.js.map +1 -1
- package/lib/commonjs/useEventEmitter.js +1 -1
- package/lib/commonjs/useEventEmitter.js.map +1 -1
- package/lib/commonjs/useFocusEffect.js +3 -4
- package/lib/commonjs/useFocusEffect.js.map +1 -1
- package/lib/commonjs/useFocusEvents.js +3 -4
- package/lib/commonjs/useFocusEvents.js.map +1 -1
- package/lib/commonjs/useFocusedListenersChildrenAdapter.js +3 -4
- package/lib/commonjs/useFocusedListenersChildrenAdapter.js.map +1 -1
- package/lib/commonjs/useIsFocused.js +3 -4
- package/lib/commonjs/useIsFocused.js.map +1 -1
- package/lib/commonjs/useKeyedChildListeners.js +1 -1
- package/lib/commonjs/useKeyedChildListeners.js.map +1 -1
- package/lib/commonjs/useNavigation.js +5 -6
- package/lib/commonjs/useNavigation.js.map +1 -1
- package/lib/commonjs/useNavigationBuilder.js +44 -45
- package/lib/commonjs/useNavigationBuilder.js.map +1 -1
- package/lib/commonjs/useNavigationCache.js +3 -4
- package/lib/commonjs/useNavigationCache.js.map +1 -1
- package/lib/commonjs/useNavigationContainerRef.js +3 -4
- package/lib/commonjs/useNavigationContainerRef.js.map +1 -1
- package/lib/commonjs/useNavigationHelpers.js +5 -6
- package/lib/commonjs/useNavigationHelpers.js.map +1 -1
- package/lib/commonjs/useNavigationIndependentTree.js +3 -4
- package/lib/commonjs/useNavigationIndependentTree.js.map +1 -1
- package/lib/commonjs/useNavigationState.js +3 -4
- package/lib/commonjs/useNavigationState.js.map +1 -1
- package/lib/commonjs/useOnAction.js +7 -8
- package/lib/commonjs/useOnAction.js.map +1 -1
- package/lib/commonjs/useOnGetState.js +7 -8
- package/lib/commonjs/useOnGetState.js.map +1 -1
- package/lib/commonjs/useOnPreventRemove.js +5 -6
- package/lib/commonjs/useOnPreventRemove.js.map +1 -1
- package/lib/commonjs/useOnRouteFocus.js +3 -4
- package/lib/commonjs/useOnRouteFocus.js.map +1 -1
- package/lib/commonjs/useOptionsGetters.js +5 -6
- package/lib/commonjs/useOptionsGetters.js.map +1 -1
- package/lib/commonjs/usePreventRemove.js +8 -8
- package/lib/commonjs/usePreventRemove.js.map +1 -1
- package/lib/commonjs/usePreventRemoveContext.js +3 -4
- package/lib/commonjs/usePreventRemoveContext.js.map +1 -1
- package/lib/commonjs/useRegisterNavigator.js +1 -1
- package/lib/commonjs/useRegisterNavigator.js.map +1 -1
- package/lib/commonjs/useRoute.js +3 -4
- package/lib/commonjs/useRoute.js.map +1 -1
- package/lib/commonjs/useRouteCache.js +1 -1
- package/lib/commonjs/useRouteCache.js.map +1 -1
- package/lib/commonjs/useScheduleUpdate.js +1 -1
- package/lib/commonjs/useScheduleUpdate.js.map +1 -1
- package/lib/commonjs/useSyncState.js +1 -1
- package/lib/commonjs/useSyncState.js.map +1 -1
- package/lib/commonjs/validatePathConfig.js +38 -11
- package/lib/commonjs/validatePathConfig.js.map +1 -1
- package/lib/module/BaseNavigationContainer.js +17 -18
- package/lib/module/BaseNavigationContainer.js.map +1 -1
- package/lib/module/CurrentRenderContext.js +1 -2
- package/lib/module/CurrentRenderContext.js.map +1 -1
- package/lib/module/DeprecatedNavigationInChildContext.js +1 -2
- package/lib/module/DeprecatedNavigationInChildContext.js.map +1 -1
- package/lib/module/EnsureSingleNavigator.js +1 -1
- package/lib/module/EnsureSingleNavigator.js.map +1 -1
- package/lib/module/Group.js +1 -1
- package/lib/module/Group.js.map +1 -1
- package/lib/module/NavigationBuilderContext.js +1 -2
- package/lib/module/NavigationBuilderContext.js.map +1 -1
- package/lib/module/NavigationContainerRefContext.js +1 -2
- package/lib/module/NavigationContainerRefContext.js.map +1 -1
- package/lib/module/NavigationContext.js +1 -2
- package/lib/module/NavigationContext.js.map +1 -1
- package/lib/module/NavigationHelpersContext.js +1 -2
- package/lib/module/NavigationHelpersContext.js.map +1 -1
- package/lib/module/NavigationIndependentTree.js +4 -4
- package/lib/module/NavigationIndependentTree.js.map +1 -1
- package/lib/module/NavigationIndependentTreeContext.js +1 -2
- package/lib/module/NavigationIndependentTreeContext.js.map +1 -1
- package/lib/module/NavigationRouteContext.js +1 -2
- package/lib/module/NavigationRouteContext.js.map +1 -1
- package/lib/module/NavigationStateContext.js +1 -1
- package/lib/module/NavigationStateContext.js.map +1 -1
- package/lib/module/PreventRemoveContext.js +1 -2
- package/lib/module/PreventRemoveContext.js.map +1 -1
- package/lib/module/PreventRemoveProvider.js +4 -4
- package/lib/module/PreventRemoveProvider.js.map +1 -1
- package/lib/module/SceneView.js +5 -5
- package/lib/module/SceneView.js.map +1 -1
- package/lib/module/Screen.js +1 -1
- package/lib/module/Screen.js.map +1 -1
- package/lib/module/StaticContainer.js +2 -3
- package/lib/module/StaticContainer.js.map +1 -1
- package/lib/module/StaticNavigation.js +2 -3
- package/lib/module/StaticNavigation.js.map +1 -1
- package/lib/module/UnhandledActionContext.js +1 -2
- package/lib/module/UnhandledActionContext.js.map +1 -1
- package/lib/module/checkDuplicateRouteNames.js +1 -1
- package/lib/module/checkDuplicateRouteNames.js.map +1 -1
- package/lib/module/checkSerializable.js +1 -1
- package/lib/module/checkSerializable.js.map +1 -1
- package/lib/module/createNavigationContainerRef.js +1 -1
- package/lib/module/createNavigationContainerRef.js.map +1 -1
- package/lib/module/createNavigatorFactory.js +3 -3
- package/lib/module/createNavigatorFactory.js.map +1 -1
- package/lib/module/findFocusedRoute.js +1 -1
- package/lib/module/findFocusedRoute.js.map +1 -1
- package/lib/module/getActionFromState.js +1 -1
- package/lib/module/getActionFromState.js.map +1 -1
- package/lib/module/getFocusedRouteNameFromRoute.js +1 -1
- package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/module/getPathFromState.js +9 -5
- package/lib/module/getPathFromState.js.map +1 -1
- package/lib/module/getStateFromPath.js +18 -3
- package/lib/module/getStateFromPath.js.map +1 -1
- package/lib/module/index.js +28 -28
- package/lib/module/index.js.map +1 -1
- package/lib/module/isArrayEqual.js +1 -1
- package/lib/module/isArrayEqual.js.map +1 -1
- package/lib/module/isRecordEqual.js +1 -1
- package/lib/module/isRecordEqual.js.map +1 -1
- package/lib/module/types.js +1 -8
- package/lib/module/types.js.map +1 -1
- package/lib/module/useChildListeners.js +1 -1
- package/lib/module/useChildListeners.js.map +1 -1
- package/lib/module/useComponent.js +1 -1
- package/lib/module/useComponent.js.map +1 -1
- package/lib/module/useCurrentRender.js +2 -2
- package/lib/module/useCurrentRender.js.map +1 -1
- package/lib/module/useDescriptors.js +7 -7
- package/lib/module/useDescriptors.js.map +1 -1
- package/lib/module/useEventEmitter.js +1 -1
- package/lib/module/useEventEmitter.js.map +1 -1
- package/lib/module/useFocusEffect.js +2 -2
- package/lib/module/useFocusEffect.js.map +1 -1
- package/lib/module/useFocusEvents.js +2 -2
- package/lib/module/useFocusEvents.js.map +1 -1
- package/lib/module/useFocusedListenersChildrenAdapter.js +2 -2
- package/lib/module/useFocusedListenersChildrenAdapter.js.map +1 -1
- package/lib/module/useIsFocused.js +2 -2
- package/lib/module/useIsFocused.js.map +1 -1
- package/lib/module/useKeyedChildListeners.js +1 -1
- package/lib/module/useKeyedChildListeners.js.map +1 -1
- package/lib/module/useNavigation.js +3 -3
- package/lib/module/useNavigation.js.map +1 -1
- package/lib/module/useNavigationBuilder.js +23 -23
- package/lib/module/useNavigationBuilder.js.map +1 -1
- package/lib/module/useNavigationCache.js +2 -2
- package/lib/module/useNavigationCache.js.map +1 -1
- package/lib/module/useNavigationContainerRef.js +2 -2
- package/lib/module/useNavigationContainerRef.js.map +1 -1
- package/lib/module/useNavigationHelpers.js +3 -3
- package/lib/module/useNavigationHelpers.js.map +1 -1
- package/lib/module/useNavigationIndependentTree.js +2 -2
- package/lib/module/useNavigationIndependentTree.js.map +1 -1
- package/lib/module/useNavigationState.js +2 -2
- package/lib/module/useNavigationState.js.map +1 -1
- package/lib/module/useOnAction.js +4 -4
- package/lib/module/useOnAction.js.map +1 -1
- package/lib/module/useOnGetState.js +4 -4
- package/lib/module/useOnGetState.js.map +1 -1
- package/lib/module/useOnPreventRemove.js +3 -3
- package/lib/module/useOnPreventRemove.js.map +1 -1
- package/lib/module/useOnRouteFocus.js +2 -2
- package/lib/module/useOnRouteFocus.js.map +1 -1
- package/lib/module/useOptionsGetters.js +3 -3
- package/lib/module/useOptionsGetters.js.map +1 -1
- package/lib/module/usePreventRemove.js +4 -4
- package/lib/module/usePreventRemove.js.map +1 -1
- package/lib/module/usePreventRemoveContext.js +2 -2
- package/lib/module/usePreventRemoveContext.js.map +1 -1
- package/lib/module/useRegisterNavigator.js +1 -1
- package/lib/module/useRegisterNavigator.js.map +1 -1
- package/lib/module/useRoute.js +2 -2
- package/lib/module/useRoute.js.map +1 -1
- package/lib/module/useRouteCache.js +1 -1
- package/lib/module/useRouteCache.js.map +1 -1
- package/lib/module/useScheduleUpdate.js +1 -1
- package/lib/module/useScheduleUpdate.js.map +1 -1
- package/lib/module/useSyncState.js +1 -1
- package/lib/module/useSyncState.js.map +1 -1
- package/lib/module/validatePathConfig.js +38 -11
- package/lib/module/validatePathConfig.js.map +1 -1
- package/lib/typescript/src/BaseNavigationContainer.d.ts +1 -2
- package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/CurrentRenderContext.d.ts +1 -2
- package/lib/typescript/src/CurrentRenderContext.d.ts.map +1 -1
- package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts +1 -2
- package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts.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/Group.d.ts +1 -1
- package/lib/typescript/src/Group.d.ts.map +1 -1
- package/lib/typescript/src/NavigationBuilderContext.d.ts +1 -2
- package/lib/typescript/src/NavigationBuilderContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationContainerRefContext.d.ts +1 -2
- package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationContext.d.ts +1 -2
- package/lib/typescript/src/NavigationContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationHelpersContext.d.ts +1 -2
- package/lib/typescript/src/NavigationHelpersContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationIndependentTree.d.ts +1 -1
- package/lib/typescript/src/NavigationIndependentTree.d.ts.map +1 -1
- package/lib/typescript/src/NavigationIndependentTreeContext.d.ts +1 -2
- package/lib/typescript/src/NavigationIndependentTreeContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationRouteContext.d.ts +1 -2
- package/lib/typescript/src/NavigationRouteContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationStateContext.d.ts +1 -2
- package/lib/typescript/src/NavigationStateContext.d.ts.map +1 -1
- package/lib/typescript/src/PreventRemoveContext.d.ts +1 -2
- 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/Screen.d.ts +1 -1
- package/lib/typescript/src/Screen.d.ts.map +1 -1
- package/lib/typescript/src/StaticContainer.d.ts +1 -3
- package/lib/typescript/src/StaticContainer.d.ts.map +1 -1
- package/lib/typescript/src/StaticNavigation.d.ts +11 -4
- package/lib/typescript/src/StaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/UnhandledActionContext.d.ts +1 -2
- package/lib/typescript/src/UnhandledActionContext.d.ts.map +1 -1
- package/lib/typescript/src/checkDuplicateRouteNames.d.ts +1 -1
- package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +1 -1
- package/lib/typescript/src/checkSerializable.d.ts +1 -1
- package/lib/typescript/src/checkSerializable.d.ts.map +1 -1
- package/lib/typescript/src/createNavigationContainerRef.d.ts +1 -1
- package/lib/typescript/src/createNavigationContainerRef.d.ts.map +1 -1
- package/lib/typescript/src/createNavigatorFactory.d.ts +1 -1
- package/lib/typescript/src/createNavigatorFactory.d.ts.map +1 -1
- package/lib/typescript/src/findFocusedRoute.d.ts +1 -1
- package/lib/typescript/src/findFocusedRoute.d.ts.map +1 -1
- package/lib/typescript/src/getActionFromState.d.ts +1 -1
- package/lib/typescript/src/getActionFromState.d.ts.map +1 -1
- package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts +1 -1
- package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +1 -1
- package/lib/typescript/src/getPathFromState.d.ts +2 -1
- package/lib/typescript/src/getPathFromState.d.ts.map +1 -1
- package/lib/typescript/src/getStateFromPath.d.ts +2 -1
- package/lib/typescript/src/getStateFromPath.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +28 -28
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/isArrayEqual.d.ts +1 -1
- package/lib/typescript/src/isArrayEqual.d.ts.map +1 -1
- package/lib/typescript/src/isRecordEqual.d.ts +1 -1
- package/lib/typescript/src/isRecordEqual.d.ts.map +1 -1
- package/lib/typescript/src/useChildListeners.d.ts +1 -1
- package/lib/typescript/src/useChildListeners.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 +1 -1
- 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/useIsFocused.d.ts +1 -1
- package/lib/typescript/src/useIsFocused.d.ts.map +1 -1
- package/lib/typescript/src/useKeyedChildListeners.d.ts +1 -1
- package/lib/typescript/src/useKeyedChildListeners.d.ts.map +1 -1
- package/lib/typescript/src/useNavigation.d.ts +1 -1
- package/lib/typescript/src/useNavigation.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 +1 -1
- package/lib/typescript/src/useNavigationCache.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationContainerRef.d.ts +1 -1
- package/lib/typescript/src/useNavigationContainerRef.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationHelpers.d.ts +17 -1
- package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationIndependentTree.d.ts +1 -1
- package/lib/typescript/src/useNavigationIndependentTree.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/lib/typescript/src/usePreventRemove.d.ts +1 -1
- package/lib/typescript/src/usePreventRemove.d.ts.map +1 -1
- package/lib/typescript/src/usePreventRemoveContext.d.ts +1 -1
- package/lib/typescript/src/usePreventRemoveContext.d.ts.map +1 -1
- package/lib/typescript/src/useRegisterNavigator.d.ts +1 -1
- package/lib/typescript/src/useRegisterNavigator.d.ts.map +1 -1
- package/lib/typescript/src/useRoute.d.ts +1 -1
- package/lib/typescript/src/useRoute.d.ts.map +1 -1
- package/lib/typescript/src/useRouteCache.d.ts +1 -1
- package/lib/typescript/src/useRouteCache.d.ts.map +1 -1
- package/lib/typescript/src/useScheduleUpdate.d.ts +1 -1
- package/lib/typescript/src/useScheduleUpdate.d.ts.map +1 -1
- package/lib/typescript/src/useSyncState.d.ts +1 -1
- package/lib/typescript/src/useSyncState.d.ts.map +1 -1
- package/lib/typescript/src/validatePathConfig.d.ts +1 -1
- package/lib/typescript/src/validatePathConfig.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/BaseNavigationContainer.tsx +17 -19
- package/src/CurrentRenderContext.tsx +1 -3
- package/src/DeprecatedNavigationInChildContext.tsx +1 -3
- package/src/EnsureSingleNavigator.tsx +1 -1
- package/src/Group.tsx +1 -1
- package/src/NavigationBuilderContext.tsx +1 -3
- package/src/NavigationContainerRefContext.tsx +1 -3
- package/src/NavigationContext.tsx +1 -3
- package/src/NavigationHelpersContext.tsx +1 -3
- package/src/NavigationIndependentTree.tsx +4 -4
- package/src/NavigationIndependentTreeContext.tsx +1 -3
- package/src/NavigationRouteContext.tsx +3 -5
- package/src/NavigationStateContext.tsx +1 -1
- package/src/PreventRemoveContext.tsx +1 -3
- package/src/PreventRemoveProvider.tsx +4 -4
- package/src/SceneView.tsx +5 -5
- package/src/Screen.tsx +1 -1
- package/src/StaticContainer.tsx +19 -18
- package/src/StaticNavigation.tsx +15 -13
- package/src/UnhandledActionContext.tsx +1 -3
- package/src/checkDuplicateRouteNames.tsx +1 -1
- package/src/checkSerializable.tsx +1 -1
- package/src/createNavigationContainerRef.tsx +1 -1
- package/src/createNavigatorFactory.tsx +3 -3
- package/src/findFocusedRoute.tsx +1 -1
- package/src/getActionFromState.tsx +1 -1
- package/src/getFocusedRouteNameFromRoute.tsx +1 -1
- package/src/getPathFromState.tsx +10 -5
- package/src/getStateFromPath.tsx +19 -3
- package/src/index.tsx +30 -30
- package/src/isArrayEqual.tsx +1 -1
- package/src/isRecordEqual.tsx +1 -4
- package/src/useChildListeners.tsx +1 -1
- package/src/useComponent.tsx +1 -1
- package/src/useCurrentRender.tsx +2 -6
- package/src/useDescriptors.tsx +8 -7
- package/src/useEventEmitter.tsx +1 -1
- package/src/useFocusEffect.tsx +2 -2
- package/src/useFocusEvents.tsx +2 -2
- package/src/useFocusedListenersChildrenAdapter.tsx +3 -2
- package/src/useIsFocused.tsx +2 -2
- package/src/useKeyedChildListeners.tsx +1 -1
- package/src/useNavigation.tsx +3 -3
- package/src/useNavigationBuilder.tsx +23 -23
- package/src/useNavigationCache.tsx +2 -2
- package/src/useNavigationContainerRef.tsx +2 -2
- package/src/useNavigationHelpers.tsx +3 -3
- package/src/useNavigationIndependentTree.tsx +2 -2
- package/src/useNavigationState.tsx +2 -2
- package/src/useOnAction.tsx +5 -4
- package/src/useOnGetState.tsx +5 -7
- package/src/useOnPreventRemove.tsx +4 -3
- package/src/useOnRouteFocus.tsx +2 -2
- package/src/useOptionsGetters.tsx +3 -7
- package/src/usePreventRemove.tsx +4 -4
- package/src/usePreventRemoveContext.tsx +2 -2
- package/src/useRegisterNavigator.tsx +1 -1
- package/src/useRoute.tsx +2 -2
- package/src/useRouteCache.tsx +1 -1
- package/src/useScheduleUpdate.tsx +1 -1
- package/src/useSyncState.tsx +1 -1
- package/src/validatePathConfig.tsx +58 -14
- package/lib/commonjs/fromEntries.js +0 -18
- package/lib/commonjs/fromEntries.js.map +0 -1
- package/lib/module/fromEntries.js +0 -12
- package/lib/module/fromEntries.js.map +0 -1
- package/lib/typescript/src/fromEntries.d.ts +0 -2
- package/lib/typescript/src/fromEntries.d.ts.map +0 -1
- package/src/fromEntries.tsx +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnGetState.d.ts","sourceRoot":"","sources":["../../../src/useOnGetState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,
|
|
1
|
+
{"version":3,"file":"useOnGetState.d.ts","sourceRoot":"","sources":["../../../src/useOnGetState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EACL,gBAAgB,EAEjB,MAAM,4BAA4B,CAAC;AAGpC,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,MAAM,eAAe,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAAC;CACjE,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,EAAE,OAAO,QA6BrE"}
|
|
@@ -12,6 +12,6 @@ export declare const shouldPreventRemove: (emitter: NavigationEventEmitter<Event
|
|
|
12
12
|
}[], nextRoutes: {
|
|
13
13
|
key?: string | undefined;
|
|
14
14
|
}[], action: NavigationAction) => boolean;
|
|
15
|
-
export
|
|
15
|
+
export declare function useOnPreventRemove({ getState, emitter, beforeRemoveListeners, }: Options): void;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=useOnPreventRemove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnPreventRemove.d.ts","sourceRoot":"","sources":["../../../src/useOnPreventRemove.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,
|
|
1
|
+
{"version":3,"file":"useOnPreventRemove.d.ts","sourceRoot":"","sources":["../../../src/useOnPreventRemove.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,yBAAyB,EAE1B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,MAAM,eAAe,CAAC;IAChC,OAAO,EAAE,sBAAsB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,SAAS,CAAC,CAAC;CAC9E,CAAC;AAIF,eAAO,MAAM,mBAAmB,YACrB,uBAAuB,aAAa,GAAG,CAAC,CAAC,yBAC3B,OAAO,MAAM,EAAE,yBAAyB,GAAG,SAAS,CAAC,iBAC7D;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,cACpB;IAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAAE,UAClC,gBAAgB,YA8CzB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,OAAO,EACP,qBAAqB,GACtB,EAAE,OAAO,QAoBT"}
|
|
@@ -10,6 +10,6 @@ type Options<Action extends NavigationAction> = {
|
|
|
10
10
|
* Focus action needs to be treated specially, coz when a nested route is focused,
|
|
11
11
|
* the parent navigators also needs to be focused.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare function useOnRouteFocus<Action extends NavigationAction>({ router, getState, key: sourceRouteKey, setState, }: Options<Action>): (key: string) => void;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=useOnRouteFocus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnRouteFocus.d.ts","sourceRoot":"","sources":["../../../src/useOnRouteFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,MAAM,EACP,MAAM,2BAA2B,CAAC;AAKnC,KAAK,OAAO,CAAC,MAAM,SAAS,gBAAgB,IAAI;IAC9C,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,eAAe,CAAC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"useOnRouteFocus.d.ts","sourceRoot":"","sources":["../../../src/useOnRouteFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,MAAM,EACP,MAAM,2BAA2B,CAAC;AAKnC,KAAK,OAAO,CAAC,MAAM,SAAS,gBAAgB,IAAI;IAC9C,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,eAAe,CAAC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAS,gBAAgB,EAAE,EAC/D,MAAM,EACN,QAAQ,EACR,GAAG,EAAE,cAAc,EACnB,QAAQ,GACT,EAAE,OAAO,CAAC,MAAM,CAAC,SAMR,MAAM,UAcf"}
|
|
@@ -5,7 +5,7 @@ type Options = {
|
|
|
5
5
|
navigation?: NavigationProp<ParamListBase>;
|
|
6
6
|
options?: object | undefined;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export declare function useOptionsGetters({ key, options, navigation }: Options): {
|
|
9
9
|
addOptionsGetter: (key: string, getter: () => object | undefined | null) => () => void;
|
|
10
10
|
getCurrentOptions: () => object | null | undefined;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOptionsGetters.d.ts","sourceRoot":"","sources":["../../../src/useOptionsGetters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAK/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,OAAO,GAAG;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"useOptionsGetters.d.ts","sourceRoot":"","sources":["../../../src/useOptionsGetters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAK/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,OAAO,GAAG;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,OAAO;4BA+D7D,MAAM,UAAU,MAAM,MAAM,GAAG,SAAS,GAAG,IAAI;;EAiBxD"}
|
|
@@ -5,7 +5,7 @@ import type { NavigationAction } from '@react-navigation/routers';
|
|
|
5
5
|
* @param preventRemove Boolean indicating whether to prevent screen from being removed.
|
|
6
6
|
* @param callback Function which is executed when screen was prevented from being removed.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare function UNSTABLE_usePreventRemove(preventRemove: boolean, callback: (options: {
|
|
9
9
|
data: {
|
|
10
10
|
action: NavigationAction;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreventRemove.d.ts","sourceRoot":"","sources":["../../../src/usePreventRemove.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAUlE;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"usePreventRemove.d.ts","sourceRoot":"","sources":["../../../src/usePreventRemove.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAUlE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAA;KAAE,CAAA;CAAE,KAAK,IAAI,QAgCpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreventRemoveContext.d.ts","sourceRoot":"","sources":["../../../src/usePreventRemoveContext.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"usePreventRemoveContext.d.ts","sourceRoot":"","sources":["../../../src/usePreventRemoveContext.tsx"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB;;;EAUtC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Register a navigator in the parent context (either a navigation container or a screen).
|
|
3
3
|
* This is used to prevent multiple navigators under a single container or screen.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export declare function useRegisterNavigator(): string;
|
|
6
6
|
//# sourceMappingURL=useRegisterNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRegisterNavigator.d.ts","sourceRoot":"","sources":["../../../src/useRegisterNavigator.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"useRegisterNavigator.d.ts","sourceRoot":"","sources":["../../../src/useRegisterNavigator.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAgB,oBAAoB,WAmBnC"}
|
|
@@ -5,5 +5,5 @@ import type { RouteProp } from './types';
|
|
|
5
5
|
*
|
|
6
6
|
* @returns Route prop of the parent screen.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare function useRoute<T extends RouteProp<ParamListBase>>(): T;
|
|
9
9
|
//# sourceMappingURL=useRoute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRoute.d.ts","sourceRoot":"","sources":["../../../src/useRoute.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"useRoute.d.ts","sourceRoot":"","sources":["../../../src/useRoute.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,CAUhE"}
|
|
@@ -10,5 +10,5 @@ export declare const CHILD_STATE: unique symbol;
|
|
|
10
10
|
* Hook to cache route props for each screen in the navigator.
|
|
11
11
|
* This lets add warnings and modifications to the route object but keep references between renders.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare function useRouteCache<State extends NavigationState>(routes: State['routes']): RouteProp<ParamListBase, string>[];
|
|
14
14
|
//# sourceMappingURL=useRouteCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouteCache.d.ts","sourceRoot":"","sources":["../../../src/useRouteCache.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EAEd,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC;;;;GAIG;AACH,eAAO,MAAM,WAAW,eAAwB,CAAC;AAEjD;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"useRouteCache.d.ts","sourceRoot":"","sources":["../../../src/useRouteCache.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EAEd,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC;;;;GAIG;AACH,eAAO,MAAM,WAAW,eAAwB,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,SAAS,eAAe,EACzD,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,sCA+BxB"}
|
|
@@ -10,5 +10,5 @@ export declare const ScheduleUpdateContext: React.Context<{
|
|
|
10
10
|
* It lets all subsequent updates access the latest state so it stays correct.
|
|
11
11
|
* Then we call setState during after the component updates.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare function useScheduleUpdate(callback: () => void): void;
|
|
14
14
|
//# sourceMappingURL=useScheduleUpdate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheduleUpdate.d.ts","sourceRoot":"","sources":["../../../src/useScheduleUpdate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,qBAAqB;+BACL,MAAM,IAAI,KAAK,IAAI;kBAChC,MAAM,IAAI;EAQxB,CAAC;AAEH;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"useScheduleUpdate.d.ts","sourceRoot":"","sources":["../../../src/useScheduleUpdate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,qBAAqB;+BACL,MAAM,IAAI,KAAK,IAAI;kBAChC,MAAM,IAAI;EAQxB,CAAC;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,QAQrD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is definitely not compatible with concurrent mode, but we don't have a solution for sync state yet.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export declare function useSyncState<T>(initialState?: (() => T) | T): readonly [T, () => T, (state: T) => void, (callback: () => void) => void, () => void];
|
|
5
5
|
//# sourceMappingURL=useSyncState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSyncState.d.ts","sourceRoot":"","sources":["../../../src/useSyncState.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"useSyncState.d.ts","sourceRoot":"","sources":["../../../src/useSyncState.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,iCAuBf,CAAC,sBAYQ,MAAM,IAAI,uBA+B/D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function validatePathConfig(config: unknown, root?: boolean): void;
|
|
2
2
|
//# sourceMappingURL=validatePathConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validatePathConfig.d.ts","sourceRoot":"","sources":["../../../src/validatePathConfig.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validatePathConfig.d.ts","sourceRoot":"","sources":["../../../src/validatePathConfig.tsx"],"names":[],"mappings":"AAKA,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,UAAO,QAsE9D"}
|
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": "7.0.0-alpha.
|
|
4
|
+
"version": "7.0.0-alpha.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"react-native",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"clean": "del lib"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@react-navigation/routers": "^7.0.0-alpha.
|
|
38
|
+
"@react-navigation/routers": "^7.0.0-alpha.1",
|
|
39
39
|
"escape-string-regexp": "^4.0.0",
|
|
40
40
|
"nanoid": "^3.1.23",
|
|
41
41
|
"query-string": "^7.1.3",
|
|
@@ -44,12 +44,12 @@
|
|
|
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.3",
|
|
49
49
|
"del-cli": "^5.0.0",
|
|
50
50
|
"immer": "^9.0.16",
|
|
51
|
-
"react": "18.
|
|
52
|
-
"react-native-builder-bob": "^0.20.
|
|
51
|
+
"react": "18.2.0",
|
|
52
|
+
"react-native-builder-bob": "^0.20.4",
|
|
53
53
|
"react-test-renderer": "18.1.0",
|
|
54
54
|
"typescript": "^4.9.4"
|
|
55
55
|
},
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
]
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "36c8f091556157dab74d3483651bbcbd340762ff"
|
|
74
74
|
}
|
|
@@ -10,29 +10,29 @@ import {
|
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
import useLatestCallback from 'use-latest-callback';
|
|
12
12
|
|
|
13
|
-
import checkDuplicateRouteNames from './checkDuplicateRouteNames';
|
|
14
|
-
import checkSerializable from './checkSerializable';
|
|
13
|
+
import { checkDuplicateRouteNames } from './checkDuplicateRouteNames';
|
|
14
|
+
import { checkSerializable } from './checkSerializable';
|
|
15
15
|
import { NOT_INITIALIZED_ERROR } from './createNavigationContainerRef';
|
|
16
|
-
import DeprecatedNavigationInChildContext from './DeprecatedNavigationInChildContext';
|
|
17
|
-
import EnsureSingleNavigator from './EnsureSingleNavigator';
|
|
18
|
-
import findFocusedRoute from './findFocusedRoute';
|
|
19
|
-
import NavigationBuilderContext from './NavigationBuilderContext';
|
|
20
|
-
import NavigationContainerRefContext from './NavigationContainerRefContext';
|
|
21
|
-
import NavigationIndependentTreeContext from './NavigationIndependentTreeContext';
|
|
22
|
-
import NavigationStateContext from './NavigationStateContext';
|
|
16
|
+
import { DeprecatedNavigationInChildContext } from './DeprecatedNavigationInChildContext';
|
|
17
|
+
import { EnsureSingleNavigator } from './EnsureSingleNavigator';
|
|
18
|
+
import { findFocusedRoute } from './findFocusedRoute';
|
|
19
|
+
import { NavigationBuilderContext } from './NavigationBuilderContext';
|
|
20
|
+
import { NavigationContainerRefContext } from './NavigationContainerRefContext';
|
|
21
|
+
import { NavigationIndependentTreeContext } from './NavigationIndependentTreeContext';
|
|
22
|
+
import { NavigationStateContext } from './NavigationStateContext';
|
|
23
23
|
import type {
|
|
24
24
|
NavigationContainerEventMap,
|
|
25
25
|
NavigationContainerProps,
|
|
26
26
|
NavigationContainerRef,
|
|
27
27
|
} from './types';
|
|
28
|
-
import UnhandledActionContext from './UnhandledActionContext';
|
|
29
|
-
import useChildListeners from './useChildListeners';
|
|
30
|
-
import useEventEmitter from './useEventEmitter';
|
|
31
|
-
import useKeyedChildListeners from './useKeyedChildListeners';
|
|
32
|
-
import useNavigationIndependentTree from './useNavigationIndependentTree';
|
|
33
|
-
import useOptionsGetters from './useOptionsGetters';
|
|
28
|
+
import { UnhandledActionContext } from './UnhandledActionContext';
|
|
29
|
+
import { useChildListeners } from './useChildListeners';
|
|
30
|
+
import { useEventEmitter } from './useEventEmitter';
|
|
31
|
+
import { useKeyedChildListeners } from './useKeyedChildListeners';
|
|
32
|
+
import { useNavigationIndependentTree } from './useNavigationIndependentTree';
|
|
33
|
+
import { useOptionsGetters } from './useOptionsGetters';
|
|
34
34
|
import { ScheduleUpdateContext } from './useScheduleUpdate';
|
|
35
|
-
import useSyncState from './useSyncState';
|
|
35
|
+
import { useSyncState } from './useSyncState';
|
|
36
36
|
|
|
37
37
|
type State = NavigationState | PartialState<NavigationState> | undefined;
|
|
38
38
|
|
|
@@ -80,7 +80,7 @@ const getPartialState = (
|
|
|
80
80
|
* @param props.children Child elements to render the content.
|
|
81
81
|
* @param props.ref Ref object which refers to the navigation object containing helper methods.
|
|
82
82
|
*/
|
|
83
|
-
const BaseNavigationContainer = React.forwardRef(
|
|
83
|
+
export const BaseNavigationContainer = React.forwardRef(
|
|
84
84
|
function BaseNavigationContainer(
|
|
85
85
|
{
|
|
86
86
|
initialState,
|
|
@@ -453,5 +453,3 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
453
453
|
);
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
|
-
|
|
457
|
-
export default BaseNavigationContainer;
|
|
@@ -4,8 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
* Context which holds the values for the current navigation tree.
|
|
5
5
|
* Intended for use in SSR. This is not safe to use on the client.
|
|
6
6
|
*/
|
|
7
|
-
const CurrentRenderContext = React.createContext<
|
|
7
|
+
export const CurrentRenderContext = React.createContext<
|
|
8
8
|
{ options?: object } | undefined
|
|
9
9
|
>(undefined);
|
|
10
|
-
|
|
11
|
-
export default CurrentRenderContext;
|
|
@@ -3,6 +3,4 @@ import * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Context which enables deprecated bubbling to child navigators.
|
|
5
5
|
*/
|
|
6
|
-
const DeprecatedNavigationInChildContext = React.createContext(false);
|
|
7
|
-
|
|
8
|
-
export default DeprecatedNavigationInChildContext;
|
|
6
|
+
export const DeprecatedNavigationInChildContext = React.createContext(false);
|
|
@@ -17,7 +17,7 @@ export const SingleNavigatorContext = React.createContext<
|
|
|
17
17
|
/**
|
|
18
18
|
* Component which ensures that there's only one navigator nested under it.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export function EnsureSingleNavigator({ children }: Props) {
|
|
21
21
|
const navigatorKeyRef = React.useRef<string | undefined>();
|
|
22
22
|
|
|
23
23
|
const value = React.useMemo(
|
package/src/Group.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import type { RouteGroupConfig } from './types';
|
|
|
5
5
|
/**
|
|
6
6
|
* Empty component used for grouping screen configs.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export function Group<
|
|
9
9
|
ParamList extends ParamListBase,
|
|
10
10
|
ScreenOptions extends {}
|
|
11
11
|
>(_: RouteGroupConfig<ParamList, ScreenOptions>) {
|
|
@@ -51,7 +51,7 @@ export type ChildBeforeRemoveListener = (action: NavigationAction) => boolean;
|
|
|
51
51
|
/**
|
|
52
52
|
* Context which holds the required helpers needed to build nested navigators.
|
|
53
53
|
*/
|
|
54
|
-
const NavigationBuilderContext = React.createContext<{
|
|
54
|
+
export const NavigationBuilderContext = React.createContext<{
|
|
55
55
|
onAction?: (
|
|
56
56
|
action: NavigationAction,
|
|
57
57
|
visitedNavigators?: Set<string>
|
|
@@ -66,5 +66,3 @@ const NavigationBuilderContext = React.createContext<{
|
|
|
66
66
|
onDispatchAction: () => undefined,
|
|
67
67
|
onOptionsChange: () => undefined,
|
|
68
68
|
});
|
|
69
|
-
|
|
70
|
-
export default NavigationBuilderContext;
|
|
@@ -6,8 +6,6 @@ import type { NavigationContainerRef } from './types';
|
|
|
6
6
|
/**
|
|
7
7
|
* Context which holds the route prop for a screen.
|
|
8
8
|
*/
|
|
9
|
-
const NavigationContainerRefContext = React.createContext<
|
|
9
|
+
export const NavigationContainerRefContext = React.createContext<
|
|
10
10
|
NavigationContainerRef<ParamListBase> | undefined
|
|
11
11
|
>(undefined);
|
|
12
|
-
|
|
13
|
-
export default NavigationContainerRefContext;
|
|
@@ -6,8 +6,6 @@ import type { NavigationProp } from './types';
|
|
|
6
6
|
/**
|
|
7
7
|
* Context which holds the navigation prop for a screen.
|
|
8
8
|
*/
|
|
9
|
-
const NavigationContext = React.createContext<
|
|
9
|
+
export const NavigationContext = React.createContext<
|
|
10
10
|
NavigationProp<ParamListBase> | undefined
|
|
11
11
|
>(undefined);
|
|
12
|
-
|
|
13
|
-
export default NavigationContext;
|
|
@@ -7,8 +7,6 @@ import type { NavigationHelpers } from './types';
|
|
|
7
7
|
* Context which holds the navigation helpers of the parent navigator.
|
|
8
8
|
* Navigators should use this context in their view component.
|
|
9
9
|
*/
|
|
10
|
-
const NavigationHelpersContext = React.createContext<
|
|
10
|
+
export const NavigationHelpersContext = React.createContext<
|
|
11
11
|
NavigationHelpers<ParamListBase> | undefined
|
|
12
12
|
>(undefined);
|
|
13
|
-
|
|
14
|
-
export default NavigationHelpersContext;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import NavigationContext from './NavigationContext';
|
|
4
|
-
import NavigationIndependentTreeContext from './NavigationIndependentTreeContext';
|
|
5
|
-
import NavigationRouteContext from './NavigationRouteContext';
|
|
3
|
+
import { NavigationContext } from './NavigationContext';
|
|
4
|
+
import { NavigationIndependentTreeContext } from './NavigationIndependentTreeContext';
|
|
5
|
+
import { NavigationRouteContext } from './NavigationRouteContext';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Component to make the child navigation container independent of parent containers.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export function NavigationIndependentTree({
|
|
11
11
|
children,
|
|
12
12
|
}: {
|
|
13
13
|
children: React.ReactNode;
|
|
@@ -3,6 +3,4 @@ import * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Context which marks the navigation tree as independent.
|
|
5
5
|
*/
|
|
6
|
-
const NavigationIndependentTreeContext = React.createContext(false);
|
|
7
|
-
|
|
8
|
-
export default NavigationIndependentTreeContext;
|
|
6
|
+
export const NavigationIndependentTreeContext = React.createContext(false);
|
|
@@ -4,8 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* Context which holds the route prop for a screen.
|
|
6
6
|
*/
|
|
7
|
-
const NavigationRouteContext = React.createContext<
|
|
8
|
-
undefined
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export default NavigationRouteContext;
|
|
7
|
+
export const NavigationRouteContext = React.createContext<
|
|
8
|
+
Route<string> | undefined
|
|
9
|
+
>(undefined);
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
const MISSING_CONTEXT_ERROR =
|
|
5
5
|
"Couldn't find a navigation context. Have you wrapped your app with 'NavigationContainer'? See https://reactnavigation.org/docs/getting-started for setup instructions.";
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export const NavigationStateContext = React.createContext<{
|
|
8
8
|
isDefault?: true;
|
|
9
9
|
state?: NavigationState | PartialState<NavigationState>;
|
|
10
10
|
getKey: () => string | undefined;
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
*/
|
|
7
7
|
export type PreventedRoutes = Record<string, { preventRemove: boolean }>;
|
|
8
8
|
|
|
9
|
-
const PreventRemoveContext = React.createContext<
|
|
9
|
+
export const PreventRemoveContext = React.createContext<
|
|
10
10
|
| {
|
|
11
11
|
preventedRoutes: PreventedRoutes;
|
|
12
12
|
setPreventRemove: (
|
|
@@ -17,5 +17,3 @@ const PreventRemoveContext = React.createContext<
|
|
|
17
17
|
}
|
|
18
18
|
| undefined
|
|
19
19
|
>(undefined);
|
|
20
|
-
|
|
21
|
-
export default PreventRemoveContext;
|
|
@@ -2,9 +2,9 @@ import { nanoid } from 'nanoid/non-secure';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useLatestCallback from 'use-latest-callback';
|
|
4
4
|
|
|
5
|
-
import NavigationHelpersContext from './NavigationHelpersContext';
|
|
6
|
-
import NavigationRouteContext from './NavigationRouteContext';
|
|
7
|
-
import
|
|
5
|
+
import { NavigationHelpersContext } from './NavigationHelpersContext';
|
|
6
|
+
import { NavigationRouteContext } from './NavigationRouteContext';
|
|
7
|
+
import { PreventedRoutes, PreventRemoveContext } from './PreventRemoveContext';
|
|
8
8
|
|
|
9
9
|
type Props = {
|
|
10
10
|
children: React.ReactNode;
|
|
@@ -42,7 +42,7 @@ const transformPreventedRoutes = (
|
|
|
42
42
|
/**
|
|
43
43
|
* Component used for managing which routes have to be prevented from removal in native-stack.
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export function PreventRemoveProvider({ children }: Props) {
|
|
46
46
|
const [parentId] = React.useState(() => nanoid());
|
|
47
47
|
const [preventedRoutesMap, setPreventedRoutesMap] =
|
|
48
48
|
React.useState<PreventedRoutesMap>(new Map());
|
package/src/SceneView.tsx
CHANGED
|
@@ -6,11 +6,11 @@ import type {
|
|
|
6
6
|
} from '@react-navigation/routers';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
|
-
import EnsureSingleNavigator from './EnsureSingleNavigator';
|
|
10
|
-
import NavigationStateContext from './NavigationStateContext';
|
|
11
|
-
import StaticContainer from './StaticContainer';
|
|
9
|
+
import { EnsureSingleNavigator } from './EnsureSingleNavigator';
|
|
10
|
+
import { NavigationStateContext } from './NavigationStateContext';
|
|
11
|
+
import { StaticContainer } from './StaticContainer';
|
|
12
12
|
import type { NavigationProp, RouteConfigComponent } from './types';
|
|
13
|
-
import useOptionsGetters from './useOptionsGetters';
|
|
13
|
+
import { useOptionsGetters } from './useOptionsGetters';
|
|
14
14
|
|
|
15
15
|
type Props<State extends NavigationState, ScreenOptions extends {}> = {
|
|
16
16
|
screen: RouteConfigComponent<ParamListBase, string> & { name: string };
|
|
@@ -33,7 +33,7 @@ type Props<State extends NavigationState, ScreenOptions extends {}> = {
|
|
|
33
33
|
* Component which takes care of rendering the screen for a route.
|
|
34
34
|
* It provides all required contexts and applies optimizations when applicable.
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export function SceneView<
|
|
37
37
|
State extends NavigationState,
|
|
38
38
|
ScreenOptions extends {}
|
|
39
39
|
>({
|
package/src/Screen.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import type { EventMapBase, RouteConfig } from './types';
|
|
|
5
5
|
/**
|
|
6
6
|
* Empty component used for specifying route configuration.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export function Screen<
|
|
9
9
|
ParamList extends ParamListBase,
|
|
10
10
|
RouteName extends keyof ParamList,
|
|
11
11
|
State extends NavigationState,
|
package/src/StaticContainer.tsx
CHANGED
|
@@ -3,27 +3,28 @@ import * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Component which prevents updates for children if no props changed
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const StaticContainer = React.memo(
|
|
7
|
+
function StaticContainer(props: any) {
|
|
8
|
+
return props.children;
|
|
9
|
+
},
|
|
10
|
+
(prevProps: any, nextProps: any) => {
|
|
11
|
+
const prevPropKeys = Object.keys(prevProps);
|
|
12
|
+
const nextPropKeys = Object.keys(nextProps);
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
if (prevPropKeys.length !== nextPropKeys.length) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
for (const key of prevPropKeys) {
|
|
19
|
+
if (key === 'children') {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
if (prevProps[key] !== nextProps[key]) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
28
|
+
return true;
|
|
26
29
|
}
|
|
27
|
-
|
|
28
|
-
return true;
|
|
29
|
-
});
|
|
30
|
+
);
|
package/src/StaticNavigation.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { NavigationState, ParamListBase } from '@react-navigation/routers';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import fromEntries from './fromEntries';
|
|
5
4
|
import type {
|
|
6
5
|
DefaultNavigatorOptions,
|
|
7
6
|
EventMapBase,
|
|
@@ -10,7 +9,7 @@ import type {
|
|
|
10
9
|
RouteConfig,
|
|
11
10
|
RouteGroupConfig,
|
|
12
11
|
} from './types';
|
|
13
|
-
import useRoute from './useRoute';
|
|
12
|
+
import { useRoute } from './useRoute';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Flatten a type to remove all type alias names, unions etc.
|
|
@@ -22,7 +21,17 @@ type FlatType<T> = { [K in keyof T]: T[K] } & {};
|
|
|
22
21
|
* keyof T doesn't work for union types. We can use distributive conditional types instead.
|
|
23
22
|
* https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types
|
|
24
23
|
*/
|
|
25
|
-
type KeysOf<T> = T extends
|
|
24
|
+
type KeysOf<T> = T extends {} ? keyof T : never;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* We get a union type when using keyof, but we want an intersection instead.
|
|
28
|
+
* https://stackoverflow.com/a/50375286/1665026
|
|
29
|
+
*/
|
|
30
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
|
|
31
|
+
k: infer I
|
|
32
|
+
) => void
|
|
33
|
+
? I
|
|
34
|
+
: never;
|
|
26
35
|
|
|
27
36
|
type UnknownToUndefined<T> = unknown extends T ? undefined : T;
|
|
28
37
|
|
|
@@ -40,14 +49,7 @@ type ParamsForScreen<T> = T extends { screen: StaticNavigation<any, any, any> }
|
|
|
40
49
|
? NavigatorScreenParams<StaticParamList<T>> | undefined
|
|
41
50
|
: UnknownToUndefined<ParamsForScreenComponent<T>>;
|
|
42
51
|
|
|
43
|
-
type ParamListForScreens<
|
|
44
|
-
Screens extends StaticConfigScreens<
|
|
45
|
-
ParamListBase,
|
|
46
|
-
NavigationState,
|
|
47
|
-
{},
|
|
48
|
-
EventMapBase
|
|
49
|
-
>
|
|
50
|
-
> = {
|
|
52
|
+
type ParamListForScreens<Screens extends unknown> = {
|
|
51
53
|
[Key in KeysOf<Screens>]: ParamsForScreen<Screens[Key]>;
|
|
52
54
|
};
|
|
53
55
|
|
|
@@ -74,7 +76,7 @@ type ParamListForGroups<
|
|
|
74
76
|
>;
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
|
-
? ParamListForScreens<Groups[keyof Groups]['screens']
|
|
79
|
+
? ParamListForScreens<UnionToIntersection<Groups[keyof Groups]['screens']>>
|
|
78
80
|
: {};
|
|
79
81
|
|
|
80
82
|
type StaticConfigScreens<
|
|
@@ -369,7 +371,7 @@ export function createPathConfigForStaticNavigation(tree: {
|
|
|
369
371
|
>;
|
|
370
372
|
};
|
|
371
373
|
}) {
|
|
372
|
-
return fromEntries(
|
|
374
|
+
return Object.fromEntries(
|
|
373
375
|
Object.entries(tree.config.screens)
|
|
374
376
|
.map(([key, item]) => {
|
|
375
377
|
const screenConfig: PathConfig<ParamListBase> = {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { NavigationAction } from '@react-navigation/routers';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
const UnhandledActionContext = React.createContext<
|
|
4
|
+
export const UnhandledActionContext = React.createContext<
|
|
5
5
|
((action: NavigationAction) => void) | undefined
|
|
6
6
|
>(undefined);
|
|
7
|
-
|
|
8
|
-
export default UnhandledActionContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NavigationState, PartialState } from '@react-navigation/routers';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export function checkDuplicateRouteNames(state: NavigationState) {
|
|
4
4
|
const duplicates: string[][] = [];
|
|
5
5
|
|
|
6
6
|
const getRouteNames = (
|