@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
package/src/useOnGetState.tsx
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import type { NavigationState } from '@react-navigation/routers';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import isArrayEqual from './isArrayEqual';
|
|
5
|
-
import
|
|
4
|
+
import { isArrayEqual } from './isArrayEqual';
|
|
5
|
+
import {
|
|
6
6
|
GetStateListener,
|
|
7
|
+
NavigationBuilderContext,
|
|
7
8
|
} from './NavigationBuilderContext';
|
|
8
|
-
import NavigationRouteContext from './NavigationRouteContext';
|
|
9
|
+
import { NavigationRouteContext } from './NavigationRouteContext';
|
|
9
10
|
|
|
10
11
|
type Options = {
|
|
11
12
|
getState: () => NavigationState;
|
|
12
13
|
getStateListeners: Record<string, GetStateListener | undefined>;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
export
|
|
16
|
-
getState,
|
|
17
|
-
getStateListeners,
|
|
18
|
-
}: Options) {
|
|
16
|
+
export function useOnGetState({ getState, getStateListeners }: Options) {
|
|
19
17
|
const { addKeyedListener } = React.useContext(NavigationBuilderContext);
|
|
20
18
|
const route = React.useContext(NavigationRouteContext);
|
|
21
19
|
const key = route ? route.key : 'root';
|
|
@@ -4,10 +4,11 @@ import type {
|
|
|
4
4
|
} from '@react-navigation/routers';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import {
|
|
8
8
|
ChildBeforeRemoveListener,
|
|
9
|
+
NavigationBuilderContext,
|
|
9
10
|
} from './NavigationBuilderContext';
|
|
10
|
-
import NavigationRouteContext from './NavigationRouteContext';
|
|
11
|
+
import { NavigationRouteContext } from './NavigationRouteContext';
|
|
11
12
|
import type { EventMapCore } from './types';
|
|
12
13
|
import type { NavigationEventEmitter } from './useEventEmitter';
|
|
13
14
|
|
|
@@ -72,7 +73,7 @@ export const shouldPreventRemove = (
|
|
|
72
73
|
return false;
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
export
|
|
76
|
+
export function useOnPreventRemove({
|
|
76
77
|
getState,
|
|
77
78
|
emitter,
|
|
78
79
|
beforeRemoveListeners,
|
package/src/useOnRouteFocus.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
} from '@react-navigation/routers';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
|
|
8
|
-
import NavigationBuilderContext from './NavigationBuilderContext';
|
|
8
|
+
import { NavigationBuilderContext } from './NavigationBuilderContext';
|
|
9
9
|
|
|
10
10
|
type Options<Action extends NavigationAction> = {
|
|
11
11
|
router: Router<NavigationState, Action>;
|
|
@@ -19,7 +19,7 @@ type Options<Action extends NavigationAction> = {
|
|
|
19
19
|
* Focus action needs to be treated specially, coz when a nested route is focused,
|
|
20
20
|
* the parent navigators also needs to be focused.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export function useOnRouteFocus<Action extends NavigationAction>({
|
|
23
23
|
router,
|
|
24
24
|
getState,
|
|
25
25
|
key: sourceRouteKey,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ParamListBase } from '@react-navigation/routers';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import NavigationBuilderContext from './NavigationBuilderContext';
|
|
5
|
-
import NavigationStateContext from './NavigationStateContext';
|
|
4
|
+
import { NavigationBuilderContext } from './NavigationBuilderContext';
|
|
5
|
+
import { NavigationStateContext } from './NavigationStateContext';
|
|
6
6
|
import type { NavigationProp } from './types';
|
|
7
7
|
|
|
8
8
|
type Options = {
|
|
@@ -11,11 +11,7 @@ type Options = {
|
|
|
11
11
|
options?: object | undefined;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export
|
|
15
|
-
key,
|
|
16
|
-
options,
|
|
17
|
-
navigation,
|
|
18
|
-
}: Options) {
|
|
14
|
+
export function useOptionsGetters({ key, options, navigation }: Options) {
|
|
19
15
|
const optionsRef = React.useRef<object | undefined>(options);
|
|
20
16
|
const optionsGettersFromChildRef = React.useRef<
|
|
21
17
|
Record<string, () => object | undefined | null>
|
package/src/usePreventRemove.tsx
CHANGED
|
@@ -4,9 +4,9 @@ import * as React from 'react';
|
|
|
4
4
|
import useLatestCallback from 'use-latest-callback';
|
|
5
5
|
|
|
6
6
|
import type { EventListenerCallback, EventMapCore } from './types';
|
|
7
|
-
import useNavigation from './useNavigation';
|
|
8
|
-
import usePreventRemoveContext from './usePreventRemoveContext';
|
|
9
|
-
import useRoute from './useRoute';
|
|
7
|
+
import { useNavigation } from './useNavigation';
|
|
8
|
+
import { usePreventRemoveContext } from './usePreventRemoveContext';
|
|
9
|
+
import { useRoute } from './useRoute';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Hook to prevent screen from being removed. Can be used to prevent users from leaving the screen.
|
|
@@ -14,7 +14,7 @@ import useRoute from './useRoute';
|
|
|
14
14
|
* @param preventRemove Boolean indicating whether to prevent screen from being removed.
|
|
15
15
|
* @param callback Function which is executed when screen was prevented from being removed.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export function UNSTABLE_usePreventRemove(
|
|
18
18
|
preventRemove: boolean,
|
|
19
19
|
callback: (options: { data: { action: NavigationAction } }) => void
|
|
20
20
|
) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import PreventRemoveContext from './PreventRemoveContext';
|
|
3
|
+
import { PreventRemoveContext } from './PreventRemoveContext';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export function usePreventRemoveContext() {
|
|
6
6
|
const value = React.useContext(PreventRemoveContext);
|
|
7
7
|
|
|
8
8
|
if (value == null) {
|
|
@@ -7,7 +7,7 @@ import { SingleNavigatorContext } from './EnsureSingleNavigator';
|
|
|
7
7
|
* Register a navigator in the parent context (either a navigation container or a screen).
|
|
8
8
|
* This is used to prevent multiple navigators under a single container or screen.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export function useRegisterNavigator() {
|
|
11
11
|
const [key] = React.useState(() => nanoid());
|
|
12
12
|
const container = React.useContext(SingleNavigatorContext);
|
|
13
13
|
|
package/src/useRoute.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ParamListBase } from '@react-navigation/routers';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import NavigationRouteContext from './NavigationRouteContext';
|
|
4
|
+
import { NavigationRouteContext } from './NavigationRouteContext';
|
|
5
5
|
import type { RouteProp } from './types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -9,7 +9,7 @@ import type { RouteProp } from './types';
|
|
|
9
9
|
*
|
|
10
10
|
* @returns Route prop of the parent screen.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export function useRoute<T extends RouteProp<ParamListBase>>(): T {
|
|
13
13
|
const route = React.useContext(NavigationRouteContext);
|
|
14
14
|
|
|
15
15
|
if (route === undefined) {
|
package/src/useRouteCache.tsx
CHANGED
|
@@ -20,7 +20,7 @@ export const CHILD_STATE = Symbol('CHILD_STATE');
|
|
|
20
20
|
* Hook to cache route props for each screen in the navigator.
|
|
21
21
|
* This lets add warnings and modifications to the route object but keep references between renders.
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export function useRouteCache<State extends NavigationState>(
|
|
24
24
|
routes: State['routes']
|
|
25
25
|
) {
|
|
26
26
|
// Cache object which holds route objects for each screen
|
|
@@ -21,7 +21,7 @@ export const ScheduleUpdateContext = React.createContext<{
|
|
|
21
21
|
* It lets all subsequent updates access the latest state so it stays correct.
|
|
22
22
|
* Then we call setState during after the component updates.
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export function useScheduleUpdate(callback: () => void) {
|
|
25
25
|
const { scheduleUpdate, flushUpdates } = React.useContext(
|
|
26
26
|
ScheduleUpdateContext
|
|
27
27
|
);
|
package/src/useSyncState.tsx
CHANGED
|
@@ -5,7 +5,7 @@ const UNINTIALIZED_STATE = {};
|
|
|
5
5
|
/**
|
|
6
6
|
* This is definitely not compatible with concurrent mode, but we don't have a solution for sync state yet.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export function useSyncState<T>(initialState?: (() => T) | T) {
|
|
9
9
|
const stateRef = React.useRef<T>(UNINTIALIZED_STATE as any);
|
|
10
10
|
const isSchedulingRef = React.useRef(false);
|
|
11
11
|
const isMountedRef = React.useRef(true);
|
|
@@ -1,28 +1,72 @@
|
|
|
1
|
-
const formatToList = (items: string
|
|
2
|
-
|
|
1
|
+
const formatToList = (items: Record<string, string>) =>
|
|
2
|
+
Object.entries(items)
|
|
3
|
+
.map(([key, value]) => `- ${key} (${value})`)
|
|
4
|
+
.join('\n');
|
|
3
5
|
|
|
4
|
-
export
|
|
5
|
-
const
|
|
6
|
+
export function validatePathConfig(config: unknown, root = true) {
|
|
7
|
+
const validation = {
|
|
8
|
+
path: 'string',
|
|
9
|
+
initialRouteName: 'string',
|
|
10
|
+
screens: 'object',
|
|
11
|
+
...(root
|
|
12
|
+
? null
|
|
13
|
+
: {
|
|
14
|
+
exact: 'boolean',
|
|
15
|
+
stringify: 'object',
|
|
16
|
+
parse: 'object',
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
6
19
|
|
|
7
|
-
if (
|
|
8
|
-
|
|
20
|
+
if (typeof config !== 'object' || config === null) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`Expected the configuration to be an object, but got ${JSON.stringify(
|
|
23
|
+
config
|
|
24
|
+
)}.`
|
|
25
|
+
);
|
|
9
26
|
}
|
|
10
27
|
|
|
11
|
-
const
|
|
12
|
-
|
|
28
|
+
const validationErrors = Object.fromEntries(
|
|
29
|
+
Object.keys(config)
|
|
30
|
+
.map((key) => {
|
|
31
|
+
if (key in validation) {
|
|
32
|
+
const type = validation[key as keyof typeof validation];
|
|
33
|
+
// @ts-expect-error: we know the key exists
|
|
34
|
+
const value = config[key];
|
|
35
|
+
|
|
36
|
+
if (typeof value !== type) {
|
|
37
|
+
return [key, `expected '${type}', got '${typeof value}'`];
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
return [key, 'extraneous'];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return null;
|
|
44
|
+
})
|
|
45
|
+
.filter(Boolean) as [string, string][]
|
|
13
46
|
);
|
|
14
47
|
|
|
15
|
-
if (
|
|
48
|
+
if (Object.keys(validationErrors).length) {
|
|
16
49
|
throw new Error(
|
|
17
50
|
`Found invalid properties in the configuration:\n${formatToList(
|
|
18
|
-
|
|
19
|
-
)}\n\
|
|
20
|
-
|
|
21
|
-
)}\n\nSee https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.`
|
|
51
|
+
validationErrors
|
|
52
|
+
)}\n\nYou can only specify the following properties:\n${formatToList(
|
|
53
|
+
validation
|
|
54
|
+
)}\n\nIf you want to specify configuration for screens, you need to specify them under a 'screens' property.\n\nSee https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (
|
|
59
|
+
root &&
|
|
60
|
+
'path' in config &&
|
|
61
|
+
typeof config.path === 'string' &&
|
|
62
|
+
config.path.includes(':')
|
|
63
|
+
) {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`Found invalid path '${config.path}'. The 'path' in the top-level configuration cannot contain patterns for params.`
|
|
22
66
|
);
|
|
23
67
|
}
|
|
24
68
|
|
|
25
|
-
if (config.screens) {
|
|
69
|
+
if ('screens' in config && config.screens) {
|
|
26
70
|
Object.entries(config.screens).forEach(([_, value]) => {
|
|
27
71
|
if (typeof value !== 'string') {
|
|
28
72
|
validatePathConfig(value, false);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = fromEntries;
|
|
7
|
-
// Object.fromEntries is not available in older iOS versions
|
|
8
|
-
function fromEntries(entries) {
|
|
9
|
-
return entries.reduce((acc, _ref) => {
|
|
10
|
-
let [k, v] = _ref;
|
|
11
|
-
if (acc.hasOwnProperty(k)) {
|
|
12
|
-
throw new Error(`A value for key '${k}' already exists in the object.`);
|
|
13
|
-
}
|
|
14
|
-
acc[k] = v;
|
|
15
|
-
return acc;
|
|
16
|
-
}, {});
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=fromEntries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["fromEntries","entries","reduce","acc","k","v","hasOwnProperty","Error"],"sourceRoot":"../../src","sources":["fromEntries.tsx"],"mappings":";;;;;;AAAA;AACe,SAASA,WAAW,CACjCC,OAA4B,EAC5B;EACA,OAAOA,OAAO,CAACC,MAAM,CAAC,CAACC,GAAG,WAAa;IAAA,IAAX,CAACC,CAAC,EAAEC,CAAC,CAAC;IAChC,IAAIF,GAAG,CAACG,cAAc,CAACF,CAAC,CAAC,EAAE;MACzB,MAAM,IAAIG,KAAK,CAAE,oBAAmBH,CAAE,iCAAgC,CAAC;IACzE;IAEAD,GAAG,CAACC,CAAC,CAAC,GAAGC,CAAC;IACV,OAAOF,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAiB;AACxB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Object.fromEntries is not available in older iOS versions
|
|
2
|
-
export default function fromEntries(entries) {
|
|
3
|
-
return entries.reduce((acc, _ref) => {
|
|
4
|
-
let [k, v] = _ref;
|
|
5
|
-
if (acc.hasOwnProperty(k)) {
|
|
6
|
-
throw new Error(`A value for key '${k}' already exists in the object.`);
|
|
7
|
-
}
|
|
8
|
-
acc[k] = v;
|
|
9
|
-
return acc;
|
|
10
|
-
}, {});
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=fromEntries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["fromEntries","entries","reduce","acc","k","v","hasOwnProperty","Error"],"sourceRoot":"../../src","sources":["fromEntries.tsx"],"mappings":"AAAA;AACA,eAAe,SAASA,WAAW,CACjCC,OAA4B,EAC5B;EACA,OAAOA,OAAO,CAACC,MAAM,CAAC,CAACC,GAAG,WAAa;IAAA,IAAX,CAACC,CAAC,EAAEC,CAAC,CAAC;IAChC,IAAIF,GAAG,CAACG,cAAc,CAACF,CAAC,CAAC,EAAE;MACzB,MAAM,IAAIG,KAAK,CAAE,oBAAmBH,CAAE,iCAAgC,CAAC;IACzE;IAEAD,GAAG,CAACC,CAAC,CAAC,GAAGC,CAAC;IACV,OAAOF,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAiB;AACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fromEntries.d.ts","sourceRoot":"","sources":["../../../src/fromEntries.tsx"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EACrD,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,gBAU7B"}
|
package/src/fromEntries.tsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Object.fromEntries is not available in older iOS versions
|
|
2
|
-
export default function fromEntries<K extends string, V>(
|
|
3
|
-
entries: (readonly [K, V])[]
|
|
4
|
-
) {
|
|
5
|
-
return entries.reduce((acc, [k, v]) => {
|
|
6
|
-
if (acc.hasOwnProperty(k)) {
|
|
7
|
-
throw new Error(`A value for key '${k}' already exists in the object.`);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
acc[k] = v;
|
|
11
|
-
return acc;
|
|
12
|
-
}, {} as Record<K, V>);
|
|
13
|
-
}
|