@react-navigation/native 8.0.0-alpha.5 → 8.0.0-alpha.50
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/android/build.gradle +8 -7
- package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +25 -10
- package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +71 -24
- package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +24 -5
- package/android/src/main/java/org/reactnavigation/MaterialSymbolViewManager.kt +14 -7
- package/android/src/main/java/org/reactnavigation/ReactNavigationPackage.kt +3 -1
- package/assets/fonts/MaterialSymbolsOutlined.codepoints +190 -24
- package/assets/fonts/MaterialSymbolsOutlined_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded.codepoints +190 -24
- package/assets/fonts/MaterialSymbolsRounded_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp.codepoints +190 -24
- package/assets/fonts/MaterialSymbolsSharp_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_700.ttf +0 -0
- package/ios/ReactNavigationCornerInsetView.h +14 -0
- package/ios/ReactNavigationCornerInsetView.mm +182 -0
- package/ios/ReactNavigationCornerInsetView.swift +193 -0
- package/ios/ReactNavigationCornerInsetViewComponentDescriptor.h +23 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.h +27 -0
- package/ios/ReactNavigationCornerInsetViewShadowNode.mm +42 -0
- package/ios/ReactNavigationCornerInsetViewState.h +19 -0
- package/ios/ReactNavigationSFSymbolView.mm +23 -10
- package/ios/ReactNavigationSFSymbolView.swift +355 -65
- package/lib/module/Link.js +80 -24
- package/lib/module/Link.js.map +1 -1
- package/lib/module/Link.native.js +72 -0
- package/lib/module/Link.native.js.map +1 -0
- package/lib/module/NavigationContainer.js +77 -33
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/__stubs__/createStackNavigator.js +11 -8
- package/lib/module/__stubs__/createStackNavigator.js.map +1 -1
- package/lib/module/checkSerializable.js +180 -0
- package/lib/module/checkSerializable.js.map +1 -0
- package/lib/module/constants.js +5 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/constants.native.js +6 -0
- package/lib/module/constants.native.js.map +1 -0
- package/lib/module/createMemoryHistory.js +27 -10
- package/lib/module/createMemoryHistory.js.map +1 -1
- package/lib/module/createStandardNavigationFactories.js +97 -0
- package/lib/module/createStandardNavigationFactories.js.map +1 -0
- package/lib/module/createStaticNavigation.js +7 -5
- package/lib/module/createStaticNavigation.js.map +1 -1
- package/lib/module/extractPathFromURL.js +2 -2
- package/lib/module/extractPathFromURL.js.map +1 -1
- package/lib/module/getStateBreadcrumb.js +37 -0
- package/lib/module/getStateBreadcrumb.js.map +1 -0
- package/lib/module/getStateFromHref.js +2 -2
- package/lib/module/getStateFromHref.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/CornerInset.ios.js +69 -0
- package/lib/module/native/CornerInset.ios.js.map +1 -0
- package/lib/module/native/CornerInset.js +12 -0
- package/lib/module/native/CornerInset.js.map +1 -0
- package/lib/module/native/MaterialSymbol.android.js +7 -16
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbol.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +7 -4
- package/lib/module/native/ReactNavigationCornerInsetViewNativeComponent.ts +31 -0
- package/lib/module/native/SFSymbol.ios.js +37 -18
- package/lib/module/native/SFSymbol.ios.js.map +1 -1
- package/lib/module/native/SFSymbol.js.map +1 -1
- package/lib/module/native/SFSymbolViewNativeComponent.ts +31 -15
- package/lib/module/server/ServerContext.js.map +1 -0
- package/lib/module/server/index.js +21 -0
- package/lib/module/server/index.js.map +1 -0
- package/lib/module/theming/DarkTheme.js +5 -5
- package/lib/module/theming/DarkTheme.js.map +1 -1
- package/lib/module/theming/LightTheme.js +16 -0
- package/lib/module/theming/LightTheme.js.map +1 -0
- package/lib/module/theming/MaterialFallbackTheme.js +28 -0
- package/lib/module/theming/MaterialFallbackTheme.js.map +1 -0
- package/lib/module/theming/MaterialTheme.android.js +33 -0
- package/lib/module/theming/MaterialTheme.android.js.map +1 -0
- package/lib/module/theming/MaterialTheme.js +4 -0
- package/lib/module/theming/MaterialTheme.js.map +1 -0
- package/lib/module/theming/fonts.js +15 -54
- package/lib/module/theming/fonts.js.map +1 -1
- package/lib/module/theming/fonts.native.js +42 -0
- package/lib/module/theming/fonts.native.js.map +1 -0
- package/lib/module/useBackButton.js.map +1 -1
- package/lib/module/useBackButton.native.js +4 -1
- package/lib/module/useBackButton.native.js.map +1 -1
- package/lib/module/useDeepStableValue.js +12 -0
- package/lib/module/useDeepStableValue.js.map +1 -0
- package/lib/module/useDocumentTitle.js.map +1 -1
- package/lib/module/useLinkBuilder.js +17 -17
- package/lib/module/useLinkBuilder.js.map +1 -1
- package/lib/module/useLinkProps.js +143 -68
- package/lib/module/useLinkProps.js.map +1 -1
- package/lib/module/useLinkTo.js +5 -5
- package/lib/module/useLinkTo.js.map +1 -1
- package/lib/module/useLinking.js +268 -58
- package/lib/module/useLinking.js.map +1 -1
- package/lib/module/useLinking.native.js +31 -12
- package/lib/module/useLinking.native.js.map +1 -1
- package/lib/module/useLocale.js +1 -1
- package/lib/module/useLocale.js.map +1 -1
- package/lib/module/useMemoArray.js +25 -0
- package/lib/module/useMemoArray.js.map +1 -0
- package/lib/module/useRoutePath.js +1 -1
- package/lib/module/useRoutePath.js.map +1 -1
- package/lib/module/useScrollToTop.js +6 -9
- package/lib/module/useScrollToTop.js.map +1 -1
- package/lib/module/useThenable.js +8 -6
- package/lib/module/useThenable.js.map +1 -1
- package/lib/typescript/src/Link.d.ts +17 -9
- package/lib/typescript/src/Link.d.ts.map +1 -1
- package/lib/typescript/src/Link.native.d.ts +4 -0
- package/lib/typescript/src/Link.native.d.ts.map +1 -0
- package/lib/typescript/src/LinkingContext.d.ts +2 -2
- package/lib/typescript/src/LinkingContext.d.ts.map +1 -1
- package/lib/typescript/src/LocaleDirContext.d.ts +1 -1
- package/lib/typescript/src/LocaleDirContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationContainer.d.ts +24 -13
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts +6 -9
- package/lib/typescript/src/__stubs__/createStackNavigator.d.ts.map +1 -1
- package/lib/typescript/src/checkSerializable.d.ts +12 -0
- package/lib/typescript/src/checkSerializable.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +4 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/constants.native.d.ts +4 -0
- package/lib/typescript/src/constants.native.d.ts.map +1 -0
- package/lib/typescript/src/createMemoryHistory.d.ts +1 -1
- package/lib/typescript/src/createMemoryHistory.d.ts.map +1 -1
- package/lib/typescript/src/createStandardNavigationFactories.d.ts +33 -0
- package/lib/typescript/src/createStandardNavigationFactories.d.ts.map +1 -0
- package/lib/typescript/src/createStaticNavigation.d.ts +9 -9
- package/lib/typescript/src/createStaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts +1 -1
- package/lib/typescript/src/extractPathFromURL.d.ts.map +1 -1
- package/lib/typescript/src/getStateBreadcrumb.d.ts +3 -0
- package/lib/typescript/src/getStateBreadcrumb.d.ts.map +1 -0
- package/lib/typescript/src/getStateFromHref.d.ts +3 -3
- package/lib/typescript/src/getStateFromHref.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -14
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/CornerInset.d.ts +32 -0
- package/lib/typescript/src/native/CornerInset.d.ts.map +1 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts +8 -0
- package/lib/typescript/src/native/CornerInset.ios.d.ts.map +1 -0
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts +9 -4
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +8 -3
- package/lib/typescript/src/native/MaterialSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +3 -3
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts +14 -0
- package/lib/typescript/src/native/ReactNavigationCornerInsetViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/native/SFSymbol.d.ts +8 -3
- package/lib/typescript/src/native/SFSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbol.ios.d.ts +9 -4
- package/lib/typescript/src/native/SFSymbol.ios.d.ts.map +1 -1
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts +27 -14
- package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/types.d.ts +241 -45
- package/lib/typescript/src/native/types.d.ts.map +1 -1
- package/lib/typescript/src/{ServerContext.d.ts → server/ServerContext.d.ts} +1 -4
- package/lib/typescript/src/server/ServerContext.d.ts.map +1 -0
- package/lib/typescript/src/server/index.d.ts +10 -0
- package/lib/typescript/src/server/index.d.ts.map +1 -0
- package/lib/typescript/src/theming/DarkTheme.d.ts +4 -38
- package/lib/typescript/src/theming/DarkTheme.d.ts.map +1 -1
- package/lib/typescript/src/theming/LightTheme.d.ts +30 -0
- package/lib/typescript/src/theming/LightTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/{DefaultTheme.d.ts → MaterialFallbackTheme.d.ts} +25 -30
- package/lib/typescript/src/theming/MaterialFallbackTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts +115 -0
- package/lib/typescript/src/theming/MaterialTheme.android.d.ts.map +1 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts +2 -0
- package/lib/typescript/src/theming/MaterialTheme.d.ts.map +1 -0
- package/lib/typescript/src/theming/fonts.d.ts +0 -34
- package/lib/typescript/src/theming/fonts.d.ts.map +1 -1
- package/lib/typescript/src/theming/fonts.native.d.ts +36 -0
- package/lib/typescript/src/theming/fonts.native.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +27 -21
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.d.ts +1 -1
- package/lib/typescript/src/useBackButton.d.ts.map +1 -1
- package/lib/typescript/src/useBackButton.native.d.ts.map +1 -1
- package/lib/typescript/src/useDeepStableValue.d.ts +2 -0
- package/lib/typescript/src/useDeepStableValue.d.ts.map +1 -0
- package/lib/typescript/src/useDocumentTitle.d.ts +2 -2
- package/lib/typescript/src/useDocumentTitle.d.ts.map +1 -1
- package/lib/typescript/src/useLinkBuilder.d.ts +62 -70
- package/lib/typescript/src/useLinkBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useLinkProps.d.ts +36 -12
- package/lib/typescript/src/useLinkProps.d.ts.map +1 -1
- package/lib/typescript/src/useLinkTo.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.d.ts +7 -49
- package/lib/typescript/src/useLinking.d.ts.map +1 -1
- package/lib/typescript/src/useLinking.native.d.ts +9 -83
- package/lib/typescript/src/useLinking.native.d.ts.map +1 -1
- package/lib/typescript/src/useLocale.d.ts +1 -1
- package/lib/typescript/src/useMemoArray.d.ts +2 -0
- package/lib/typescript/src/useMemoArray.d.ts.map +1 -0
- package/lib/typescript/src/useScrollToTop.d.ts +1 -4
- package/lib/typescript/src/useScrollToTop.d.ts.map +1 -1
- package/lib/typescript/src/useThenable.d.ts +1 -1
- package/lib/typescript/src/useThenable.d.ts.map +1 -1
- package/package.json +48 -23
- package/src/Link.native.tsx +69 -0
- package/src/Link.tsx +126 -37
- package/src/LinkingContext.tsx +1 -1
- package/src/NavigationContainer.tsx +139 -69
- package/src/__stubs__/createStackNavigator.tsx +20 -18
- package/src/checkSerializable.tsx +246 -0
- package/src/constants.native.tsx +10 -0
- package/src/constants.tsx +5 -0
- package/src/createMemoryHistory.tsx +32 -10
- package/src/createStandardNavigationFactories.tsx +217 -0
- package/src/createStaticNavigation.tsx +32 -31
- package/src/extractPathFromURL.tsx +5 -3
- package/src/getStateBreadcrumb.tsx +44 -0
- package/src/getStateFromHref.tsx +8 -3
- package/src/index.tsx +11 -2
- package/src/native/CornerInset.ios.tsx +87 -0
- package/src/native/CornerInset.tsx +44 -0
- package/src/native/MaterialSymbol.android.tsx +11 -22
- package/src/native/MaterialSymbol.tsx +7 -2
- package/src/native/MaterialSymbolData.tsx +166 -0
- package/src/native/MaterialSymbolViewNativeComponent.ts +7 -4
- package/src/native/ReactNavigationCornerInsetViewNativeComponent.ts +31 -0
- package/src/native/SFSymbol.ios.tsx +80 -18
- package/src/native/SFSymbol.tsx +7 -2
- package/src/native/SFSymbolViewNativeComponent.ts +31 -15
- package/src/native/types.tsx +297 -47
- package/src/{ServerContext.tsx → server/ServerContext.tsx} +1 -4
- package/src/server/index.tsx +19 -0
- package/src/theming/DarkTheme.tsx +4 -4
- package/src/theming/{DefaultTheme.tsx → LightTheme.tsx} +4 -4
- package/src/theming/MaterialFallbackTheme.tsx +29 -0
- package/src/theming/MaterialTheme.android.tsx +45 -0
- package/src/theming/MaterialTheme.tsx +4 -0
- package/src/theming/fonts.native.tsx +41 -0
- package/src/theming/fonts.tsx +15 -54
- package/src/types.tsx +52 -45
- package/src/useBackButton.native.tsx +2 -0
- package/src/useBackButton.tsx +2 -2
- package/src/useDeepStableValue.tsx +12 -0
- package/src/useDocumentTitle.tsx +2 -2
- package/src/useLinkBuilder.tsx +29 -25
- package/src/useLinkProps.tsx +371 -127
- package/src/useLinkTo.tsx +9 -8
- package/src/useLinking.native.tsx +70 -39
- package/src/useLinking.tsx +426 -87
- package/src/useLocale.tsx +1 -1
- package/src/useMemoArray.tsx +41 -0
- package/src/useRoutePath.tsx +1 -1
- package/src/useScrollToTop.tsx +21 -13
- package/src/useThenable.tsx +9 -7
- package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/results.bin +0 -1
- package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/results.bin +0 -1
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/BuildConfig.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$Companion.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$WhenMappings.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$getImageSource$1.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypeface.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypefaceResult.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolView.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager$Companion.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolViewManager.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/ReactNavigationPackage.dex +0 -0
- package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/org/reactnavigation/BuildConfig.java +0 -10
- package/android/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.java +0 -39
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.java +0 -45
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.java +0 -22
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.java +0 -81
- package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.java +0 -34
- package/android/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
- package/android/build/generated/source/codegen/jni/ReactNavigationSpec-generated.cpp +0 -32
- package/android/build/generated/source/codegen/jni/ReactNavigationSpec.h +0 -31
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.cpp +0 -23
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ComponentDescriptors.h +0 -25
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.cpp +0 -17
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/EventEmitters.h +0 -30
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.cpp +0 -176
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.h +0 -132
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI-generated.cpp +0 -31
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI.h +0 -71
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.cpp +0 -18
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ShadowNodes.h +0 -43
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.cpp +0 -16
- package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/States.h +0 -22
- package/android/build/generated/source/codegen/schema.json +0 -1
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbols.hash +0 -1
- package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/org/reactnavigation/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbols.hash +0 -1
- package/android/build/intermediates/react-navigation/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/ReactNavigationPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerDelegate.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerInterface.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-navigation_native_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolViewManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/ReactNavigationPackage.class +0 -0
- package/lib/module/ServerContainer.js +0 -55
- package/lib/module/ServerContainer.js.map +0 -1
- package/lib/module/ServerContext.js.map +0 -1
- package/lib/module/__stubs__/window.js +0 -75
- package/lib/module/__stubs__/window.js.map +0 -1
- package/lib/module/theming/DefaultTheme.js +0 -16
- package/lib/module/theming/DefaultTheme.js.map +0 -1
- package/lib/typescript/src/ServerContainer.d.ts +0 -14
- package/lib/typescript/src/ServerContainer.d.ts.map +0 -1
- package/lib/typescript/src/ServerContext.d.ts.map +0 -1
- package/lib/typescript/src/__stubs__/window.d.ts +0 -18
- package/lib/typescript/src/__stubs__/window.d.ts.map +0 -1
- package/lib/typescript/src/theming/DefaultTheme.d.ts.map +0 -1
- package/src/ServerContainer.tsx +0 -57
- package/src/__stubs__/window.tsx +0 -77
- /package/lib/module/{ServerContext.js → server/ServerContext.js} +0 -0
package/src/Link.tsx
CHANGED
|
@@ -1,72 +1,161 @@
|
|
|
1
1
|
import { type RootParamList, useTheme } from '@react-navigation/core';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
type GestureResponderEvent,
|
|
5
|
-
Platform,
|
|
6
|
-
Text,
|
|
7
|
-
type TextProps,
|
|
8
|
-
} from 'react-native';
|
|
3
|
+
import type { GestureResponderEvent, TextProps, TextStyle } from 'react-native';
|
|
9
4
|
|
|
10
5
|
import { type LinkProps, useLinkProps } from './useLinkProps';
|
|
11
6
|
|
|
12
|
-
type
|
|
7
|
+
type PressEvent =
|
|
8
|
+
| React.MouseEvent<HTMLAnchorElement, MouseEvent>
|
|
9
|
+
| GestureResponderEvent;
|
|
10
|
+
|
|
11
|
+
type LinkBaseProps = {
|
|
12
|
+
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
testID?: string | undefined;
|
|
16
|
+
onPress?: ((e: PressEvent) => void) | undefined;
|
|
17
|
+
numberOfLines?: number | undefined;
|
|
18
|
+
className?: React.AnchorHTMLAttributes<HTMLAnchorElement>['className'];
|
|
19
|
+
style?: (React.CSSProperties & TextStyle) | undefined;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
} & Pick<
|
|
22
|
+
TextProps,
|
|
23
|
+
| 'aria-busy'
|
|
24
|
+
| 'aria-expanded'
|
|
25
|
+
| 'aria-hidden'
|
|
26
|
+
| 'aria-label'
|
|
27
|
+
| 'aria-labelledby'
|
|
28
|
+
| 'aria-live'
|
|
29
|
+
>;
|
|
30
|
+
|
|
31
|
+
export type Props<
|
|
13
32
|
ParamList extends {} = RootParamList,
|
|
14
|
-
RouteName extends keyof ParamList =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent
|
|
20
|
-
) => void;
|
|
21
|
-
disabled?: boolean | null;
|
|
22
|
-
children: React.ReactNode;
|
|
23
|
-
};
|
|
33
|
+
RouteName extends Extract<keyof ParamList, string> = Extract<
|
|
34
|
+
keyof ParamList,
|
|
35
|
+
string
|
|
36
|
+
>,
|
|
37
|
+
> = LinkProps<NoInfer<ParamList>, RouteName> & LinkBaseProps;
|
|
24
38
|
|
|
25
39
|
/**
|
|
26
40
|
* Component to render link to another screen using a path.
|
|
27
41
|
* Uses an anchor tag on the web.
|
|
28
42
|
*
|
|
43
|
+
* @param props.in Name of the current or parent screen whose navigator contains the target screen.
|
|
29
44
|
* @param props.screen Name of the screen to navigate to (e.g. `'Feeds'`).
|
|
30
45
|
* @param props.params Params to pass to the screen to navigate to (e.g. `{ sort: 'hot' }`).
|
|
31
46
|
* @param props.href Optional absolute path to use for the href (e.g. `/feeds/hot`).
|
|
32
|
-
* @param props.action Optional action to
|
|
47
|
+
* @param props.action Optional action to override the in-page navigation. The `href` is still derived from `screen`, so this can be used to render a link while dispatching a different action (e.g. a `replace`).
|
|
33
48
|
* @param props.children Child elements to render the content.
|
|
34
49
|
*/
|
|
35
50
|
export function Link<
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
ParamList extends {} = RootParamList,
|
|
52
|
+
RouteName extends Extract<keyof ParamList, string> = Extract<
|
|
53
|
+
keyof ParamList,
|
|
54
|
+
string
|
|
55
|
+
>,
|
|
38
56
|
>({
|
|
57
|
+
in: parent,
|
|
39
58
|
screen,
|
|
40
59
|
params,
|
|
41
60
|
action,
|
|
42
61
|
href,
|
|
62
|
+
target,
|
|
63
|
+
disabled,
|
|
64
|
+
id,
|
|
65
|
+
testID,
|
|
66
|
+
onPress,
|
|
67
|
+
className,
|
|
43
68
|
style,
|
|
44
|
-
|
|
69
|
+
children,
|
|
70
|
+
'aria-label': ariaLabel,
|
|
71
|
+
'aria-busy': ariaBusy,
|
|
72
|
+
'aria-expanded': ariaExpanded,
|
|
73
|
+
'aria-hidden': ariaHidden,
|
|
74
|
+
'aria-labelledby': ariaLabelledBy,
|
|
75
|
+
'aria-live': ariaLive,
|
|
45
76
|
}: Props<ParamList, RouteName>) {
|
|
77
|
+
// @ts-expect-error: destructuring loses the relationship between target props
|
|
78
|
+
const props = useLinkProps({ in: parent, screen, params, action, href });
|
|
79
|
+
|
|
80
|
+
// Keep usage of `useTheme` after `useLinkProps`
|
|
81
|
+
// This ensures proper error when used outside of navigation container
|
|
46
82
|
const { colors, fonts } = useTheme();
|
|
47
|
-
// @ts-expect-error: This is already type-checked by the prop types
|
|
48
|
-
const props = useLinkProps<ParamList>({ screen, params, action, href });
|
|
49
83
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
84
|
+
if (typeof colors.primary !== 'string') {
|
|
85
|
+
throw new Error('Invalid color format.');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const onClick = (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
|
89
|
+
if (disabled) {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
return;
|
|
55
93
|
}
|
|
56
94
|
|
|
95
|
+
onPress?.(e);
|
|
96
|
+
|
|
57
97
|
// Let user prevent default behavior
|
|
58
98
|
if (!e.defaultPrevented) {
|
|
59
99
|
props.onPress(e);
|
|
60
100
|
}
|
|
61
101
|
};
|
|
62
102
|
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
103
|
+
return (
|
|
104
|
+
<a
|
|
105
|
+
aria-busy={ariaBusy}
|
|
106
|
+
aria-disabled={disabled}
|
|
107
|
+
aria-expanded={ariaExpanded}
|
|
108
|
+
aria-hidden={ariaHidden}
|
|
109
|
+
aria-label={ariaLabel}
|
|
110
|
+
aria-labelledby={ariaLabelledBy}
|
|
111
|
+
aria-live={ariaLive}
|
|
112
|
+
id={id}
|
|
113
|
+
data-testid={testID}
|
|
114
|
+
tabIndex={props.href == null ? 0 : undefined}
|
|
115
|
+
target={target}
|
|
116
|
+
role={props.role}
|
|
117
|
+
href={props.href}
|
|
118
|
+
onAuxClick={
|
|
119
|
+
disabled
|
|
120
|
+
? (e) => {
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
e.stopPropagation();
|
|
123
|
+
}
|
|
124
|
+
: undefined
|
|
125
|
+
}
|
|
126
|
+
onClick={onClick}
|
|
127
|
+
onKeyDown={
|
|
128
|
+
props.href == null
|
|
129
|
+
? (e) => {
|
|
130
|
+
// On browser, pressing Enter on a link triggers a click event
|
|
131
|
+
// So we simulate browser behavior when href is not provided
|
|
132
|
+
if (e.key === 'Enter') {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
e.currentTarget.click();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
: undefined
|
|
138
|
+
}
|
|
139
|
+
className={className}
|
|
140
|
+
style={{
|
|
141
|
+
backgroundColor: 'transparent',
|
|
142
|
+
boxSizing: 'border-box',
|
|
143
|
+
color: colors.primary,
|
|
144
|
+
cursor: disabled ? 'default' : 'pointer',
|
|
145
|
+
display: 'inline',
|
|
146
|
+
fontSize: 14,
|
|
147
|
+
margin: 0,
|
|
148
|
+
overflowWrap: 'break-word',
|
|
149
|
+
padding: 0,
|
|
150
|
+
position: 'relative',
|
|
151
|
+
textAlign: 'start',
|
|
152
|
+
textDecoration: 'none',
|
|
153
|
+
whiteSpace: 'pre-wrap',
|
|
154
|
+
...fonts.regular,
|
|
155
|
+
...style,
|
|
156
|
+
}}
|
|
157
|
+
>
|
|
158
|
+
{children}
|
|
159
|
+
</a>
|
|
160
|
+
);
|
|
72
161
|
}
|
package/src/LinkingContext.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import type { LinkingOptions } from './types';
|
|
|
6
6
|
const MISSING_CONTEXT_ERROR = "Couldn't find a LinkingContext context.";
|
|
7
7
|
|
|
8
8
|
export const LinkingContext = React.createContext<{
|
|
9
|
-
options?: LinkingOptions<ParamListBase
|
|
9
|
+
options?: LinkingOptions<ParamListBase> | undefined;
|
|
10
10
|
}>({
|
|
11
11
|
get options(): any {
|
|
12
12
|
throw new Error(MISSING_CONTEXT_ERROR);
|
|
@@ -6,17 +6,21 @@ import {
|
|
|
6
6
|
type InitialState,
|
|
7
7
|
type NavigationContainerProps,
|
|
8
8
|
type NavigationContainerRef,
|
|
9
|
-
type
|
|
9
|
+
type NavigationState,
|
|
10
|
+
type PartialState,
|
|
10
11
|
type RootParamList,
|
|
11
12
|
ThemeProvider,
|
|
12
13
|
validatePathConfig,
|
|
13
14
|
} from '@react-navigation/core';
|
|
14
15
|
import * as React from 'react';
|
|
15
|
-
import
|
|
16
|
+
import warnOnce from 'warn-once';
|
|
16
17
|
|
|
18
|
+
import { checkSerializable } from './checkSerializable';
|
|
19
|
+
import { DEFAULT_DIRECTION, IS_NATIVE } from './constants';
|
|
20
|
+
import { getStateBreadcrumb } from './getStateBreadcrumb';
|
|
17
21
|
import { LinkingContext } from './LinkingContext';
|
|
18
22
|
import { LocaleDirContext } from './LocaleDirContext';
|
|
19
|
-
import {
|
|
23
|
+
import { LightTheme } from './theming/LightTheme';
|
|
20
24
|
import type {
|
|
21
25
|
DocumentTitleOptions,
|
|
22
26
|
LinkingOptions,
|
|
@@ -30,8 +34,17 @@ import { type Thenable, useThenable } from './useThenable';
|
|
|
30
34
|
|
|
31
35
|
declare global {
|
|
32
36
|
var REACT_NAVIGATION_DEVTOOLS: WeakMap<
|
|
33
|
-
|
|
34
|
-
{
|
|
37
|
+
object,
|
|
38
|
+
{
|
|
39
|
+
readonly linking: LinkingOptions<any>;
|
|
40
|
+
readonly listeners: Set<
|
|
41
|
+
(data: {
|
|
42
|
+
type: 'link';
|
|
43
|
+
url: string;
|
|
44
|
+
state: PartialState<NavigationState> | undefined;
|
|
45
|
+
}) => void
|
|
46
|
+
>;
|
|
47
|
+
}
|
|
35
48
|
>;
|
|
36
49
|
}
|
|
37
50
|
|
|
@@ -49,14 +62,14 @@ type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
|
49
62
|
/**
|
|
50
63
|
* Text direction of the components. Defaults to `'ltr'`.
|
|
51
64
|
*/
|
|
52
|
-
direction?: LocaleDirection;
|
|
65
|
+
direction?: LocaleDirection | undefined;
|
|
53
66
|
/**
|
|
54
67
|
* Options for deep linking.
|
|
55
68
|
*
|
|
56
69
|
* Deep link handling is enabled when this prop is provided,
|
|
57
70
|
* unless `linking.enabled` is `false`.
|
|
58
71
|
*/
|
|
59
|
-
linking?: LinkingOptions<ParamList
|
|
72
|
+
linking?: LinkingOptions<ParamList> | undefined;
|
|
60
73
|
/**
|
|
61
74
|
* Persistor object to persist and restore navigation state.
|
|
62
75
|
*
|
|
@@ -68,57 +81,71 @@ type Props<ParamList extends {}> = NavigationContainerProps & {
|
|
|
68
81
|
* ```ts
|
|
69
82
|
* const persistor = {
|
|
70
83
|
* async persist(state) {
|
|
71
|
-
*
|
|
84
|
+
* if (state == null) {
|
|
85
|
+
* await AsyncStorage.removeItem('state-key-v1');
|
|
86
|
+
* } else {
|
|
87
|
+
* await AsyncStorage.setItem('state-key-v1', state);
|
|
88
|
+
* }
|
|
72
89
|
* },
|
|
73
90
|
* async restore() {
|
|
74
91
|
* const state = await AsyncStorage.getItem('state-key-v1');
|
|
75
92
|
*
|
|
76
|
-
* return state
|
|
93
|
+
* return state ?? undefined;
|
|
77
94
|
* },
|
|
78
95
|
* };
|
|
79
96
|
*
|
|
80
97
|
* <NavigationContainer persistor={persistor}>...</NavigationContainer>
|
|
81
98
|
* ```
|
|
82
99
|
*/
|
|
83
|
-
persistor?: Persistor;
|
|
100
|
+
persistor?: Persistor | undefined;
|
|
84
101
|
/**
|
|
85
102
|
* Fallback element to render until initial state is resolved.
|
|
86
103
|
* Used when deep link or persisted state is being restored asynchronously.
|
|
87
104
|
*
|
|
88
105
|
* Defaults to `null`.
|
|
89
106
|
*/
|
|
90
|
-
fallback?: React.ReactElement | null;
|
|
107
|
+
fallback?: React.ReactElement | null | undefined;
|
|
91
108
|
/**
|
|
92
109
|
* Options to configure the document title on Web.
|
|
93
110
|
*
|
|
94
111
|
* Updating document title is handled by default,
|
|
95
112
|
* unless `documentTitle.enabled` is `false`.
|
|
96
113
|
*/
|
|
97
|
-
documentTitle?: DocumentTitleOptions;
|
|
114
|
+
documentTitle?: DocumentTitleOptions | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Ref object which refers to the navigation object containing helper methods.
|
|
117
|
+
*/
|
|
118
|
+
ref?: React.Ref<NavigationContainerRef<ParamList>> | undefined;
|
|
98
119
|
};
|
|
99
120
|
|
|
100
121
|
const RESTORE_STATE_ERROR =
|
|
101
122
|
'Failed to restore navigation state. The state will be initialized based on the navigation tree.';
|
|
102
123
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
documentTitle,
|
|
111
|
-
onStateChange,
|
|
112
|
-
...rest
|
|
113
|
-
}: Props<ParamListBase>,
|
|
114
|
-
ref?: React.Ref<NavigationContainerRef<ParamListBase> | null>
|
|
115
|
-
) {
|
|
116
|
-
if (linking?.config) {
|
|
117
|
-
validatePathConfig(linking.config);
|
|
118
|
-
}
|
|
124
|
+
const PARSE_STATE_ERROR =
|
|
125
|
+
'Failed to parse the restored navigation state. The state will be initialized based on the navigation tree.';
|
|
126
|
+
|
|
127
|
+
const PERSIST_STATE_ERROR = 'Failed to persist the navigation state.';
|
|
128
|
+
|
|
129
|
+
const STRINGIFY_STATE_ERROR =
|
|
130
|
+
'Failed to stringify the navigation state. The state will not be persisted.';
|
|
119
131
|
|
|
120
|
-
|
|
121
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Container component that manages the navigation state.
|
|
134
|
+
*
|
|
135
|
+
* This should be rendered at the root wrapping the whole app.
|
|
136
|
+
*/
|
|
137
|
+
export function NavigationContainer<ParamList extends {} = RootParamList>({
|
|
138
|
+
direction = DEFAULT_DIRECTION,
|
|
139
|
+
theme = LightTheme,
|
|
140
|
+
linking,
|
|
141
|
+
persistor,
|
|
142
|
+
fallback = null,
|
|
143
|
+
documentTitle,
|
|
144
|
+
onStateChange,
|
|
145
|
+
ref,
|
|
146
|
+
...rest
|
|
147
|
+
}: Props<ParamList>) {
|
|
148
|
+
const refContainer = React.useRef<NavigationContainerRef<ParamList>>(null);
|
|
122
149
|
|
|
123
150
|
useBackButton(refContainer);
|
|
124
151
|
useDocumentTitle(refContainer, documentTitle);
|
|
@@ -132,6 +159,10 @@ function NavigationContainerInner(
|
|
|
132
159
|
};
|
|
133
160
|
}
|
|
134
161
|
|
|
162
|
+
if (linking?.config) {
|
|
163
|
+
validatePathConfig(linking.config);
|
|
164
|
+
}
|
|
165
|
+
|
|
135
166
|
return {
|
|
136
167
|
options: {
|
|
137
168
|
...linking,
|
|
@@ -150,10 +181,16 @@ function NavigationContainerInner(
|
|
|
150
181
|
// This will be used by the devtools
|
|
151
182
|
React.useEffect(() => {
|
|
152
183
|
if (refContainer.current) {
|
|
184
|
+
const previous = REACT_NAVIGATION_DEVTOOLS.get(refContainer.current);
|
|
185
|
+
const listeners = previous?.listeners ?? new Set();
|
|
186
|
+
|
|
153
187
|
REACT_NAVIGATION_DEVTOOLS.set(refContainer.current, {
|
|
154
188
|
get linking() {
|
|
155
189
|
return linkingConfig.options;
|
|
156
190
|
},
|
|
191
|
+
get listeners() {
|
|
192
|
+
return listeners;
|
|
193
|
+
},
|
|
157
194
|
});
|
|
158
195
|
}
|
|
159
196
|
});
|
|
@@ -166,11 +203,10 @@ function NavigationContainerInner(
|
|
|
166
203
|
return getInitialState();
|
|
167
204
|
});
|
|
168
205
|
|
|
169
|
-
const isPersistenceSupported =
|
|
170
|
-
Platform.OS === 'web' ? !linkingConfig.options.enabled : true;
|
|
206
|
+
const isPersistenceSupported = IS_NATIVE || !linkingConfig.options.enabled;
|
|
171
207
|
|
|
172
208
|
const [isPersistedStateResolved, initialStateFromPersisted] = useThenable(
|
|
173
|
-
() => {
|
|
209
|
+
(): InitialState | undefined | Thenable<InitialState | undefined> => {
|
|
174
210
|
if (
|
|
175
211
|
isPersistenceSupported === false ||
|
|
176
212
|
rest.initialState != null ||
|
|
@@ -179,42 +215,88 @@ function NavigationContainerInner(
|
|
|
179
215
|
return undefined;
|
|
180
216
|
}
|
|
181
217
|
|
|
182
|
-
|
|
218
|
+
const parse = (
|
|
219
|
+
serializedState: string | undefined
|
|
220
|
+
): InitialState | undefined => {
|
|
221
|
+
if (serializedState == null) {
|
|
222
|
+
return undefined;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
try {
|
|
226
|
+
return persistor.parse
|
|
227
|
+
? persistor.parse(serializedState)
|
|
228
|
+
: JSON.parse(serializedState);
|
|
229
|
+
} catch (e) {
|
|
230
|
+
console.error(PARSE_STATE_ERROR, e);
|
|
231
|
+
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
183
235
|
|
|
184
236
|
try {
|
|
185
|
-
|
|
237
|
+
const result = persistor.restore();
|
|
238
|
+
|
|
239
|
+
return result != null && typeof result === 'object' && 'then' in result
|
|
240
|
+
? result.then(parse, (e) => {
|
|
241
|
+
console.error(RESTORE_STATE_ERROR, e);
|
|
242
|
+
|
|
243
|
+
return undefined;
|
|
244
|
+
})
|
|
245
|
+
: parse(result);
|
|
186
246
|
} catch (e) {
|
|
187
247
|
console.error(RESTORE_STATE_ERROR, e);
|
|
188
248
|
|
|
189
249
|
return undefined;
|
|
190
250
|
}
|
|
251
|
+
}
|
|
252
|
+
);
|
|
191
253
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
254
|
+
const onPersistState = (state: Readonly<NavigationState> | undefined) => {
|
|
255
|
+
if (persistor == null) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
195
258
|
|
|
196
|
-
|
|
197
|
-
return restoredState.then(
|
|
198
|
-
(state) => state,
|
|
199
|
-
(error) => {
|
|
200
|
-
console.error(RESTORE_STATE_ERROR, error);
|
|
259
|
+
let serializedState: string | undefined;
|
|
201
260
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
)
|
|
261
|
+
try {
|
|
262
|
+
serializedState = persistor.stringify
|
|
263
|
+
? persistor.stringify(state)
|
|
264
|
+
: JSON.stringify(state);
|
|
265
|
+
} catch (e) {
|
|
266
|
+
console.error(STRINGIFY_STATE_ERROR, e);
|
|
267
|
+
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
try {
|
|
272
|
+
const value = persistor.persist(serializedState);
|
|
273
|
+
|
|
274
|
+
if (value != null && typeof value === 'object' && 'then' in value) {
|
|
275
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
276
|
+
value.then(undefined, (e) => {
|
|
277
|
+
console.error(PERSIST_STATE_ERROR, e);
|
|
278
|
+
});
|
|
205
279
|
}
|
|
280
|
+
} catch (e) {
|
|
281
|
+
console.error(PERSIST_STATE_ERROR, e);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
206
284
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
},
|
|
213
|
-
};
|
|
285
|
+
const onSerializableCheck = (
|
|
286
|
+
state: Readonly<NavigationState> | undefined
|
|
287
|
+
) => {
|
|
288
|
+
if (process.env.NODE_ENV !== 'production' && state != null) {
|
|
289
|
+
const result = checkSerializable(state);
|
|
214
290
|
|
|
215
|
-
|
|
291
|
+
if (!result.serializable) {
|
|
292
|
+
const breadcrumb = getStateBreadcrumb(state, result.location);
|
|
293
|
+
|
|
294
|
+
const message = `Non-serializable values were found in the navigation state. Check:\n\n${breadcrumb} (${result.reason})\n\nThis can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc. in params. If you need to use components with callbacks in your options, you can use 'navigation.setOptions' instead. See https://reactnavigation.org/docs/troubleshooting#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state for more details.`;
|
|
295
|
+
|
|
296
|
+
warnOnce(true, message);
|
|
297
|
+
}
|
|
216
298
|
}
|
|
217
|
-
|
|
299
|
+
};
|
|
218
300
|
|
|
219
301
|
// FIXME
|
|
220
302
|
// @ts-expect-error not sure why this is not working
|
|
@@ -245,7 +327,8 @@ function NavigationContainerInner(
|
|
|
245
327
|
}
|
|
246
328
|
onStateChange={(state) => {
|
|
247
329
|
onStateChange?.(state);
|
|
248
|
-
|
|
330
|
+
onPersistState(state);
|
|
331
|
+
onSerializableCheck(state);
|
|
249
332
|
}}
|
|
250
333
|
ref={refContainer}
|
|
251
334
|
/>
|
|
@@ -253,16 +336,3 @@ function NavigationContainerInner(
|
|
|
253
336
|
</LocaleDirContext.Provider>
|
|
254
337
|
);
|
|
255
338
|
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Container component that manages the navigation state.
|
|
259
|
-
*
|
|
260
|
-
* This should be rendered at the root wrapping the whole app.
|
|
261
|
-
*/
|
|
262
|
-
export const NavigationContainer = React.forwardRef(
|
|
263
|
-
NavigationContainerInner
|
|
264
|
-
) as <ParamList extends {} = RootParamList>(
|
|
265
|
-
props: Props<ParamList> & {
|
|
266
|
-
ref?: React.Ref<NavigationContainerRef<ParamList>>;
|
|
267
|
-
}
|
|
268
|
-
) => React.ReactElement;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createNavigatorFactory,
|
|
3
3
|
type DefaultNavigatorOptions,
|
|
4
|
-
type
|
|
4
|
+
type NavigatorTypeBagBase,
|
|
5
5
|
type ParamListBase,
|
|
6
6
|
type StackNavigationState,
|
|
7
7
|
StackRouter,
|
|
8
|
-
type TypedNavigator,
|
|
9
8
|
useNavigationBuilder,
|
|
10
9
|
} from '@react-navigation/core';
|
|
11
10
|
|
|
@@ -18,27 +17,30 @@ const StackNavigator = (
|
|
|
18
17
|
unknown
|
|
19
18
|
>
|
|
20
19
|
) => {
|
|
21
|
-
const { state, descriptors,
|
|
20
|
+
const { state, descriptors, render } = useNavigationBuilder(
|
|
22
21
|
StackRouter,
|
|
23
22
|
props
|
|
24
23
|
);
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
const route = state.routes[state.index];
|
|
26
|
+
|
|
27
|
+
if (route == null) {
|
|
28
|
+
throw new Error(`Couldn't find a route at index ${state.index}.`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const descriptor = descriptors[route.key];
|
|
32
|
+
|
|
33
|
+
if (descriptor == null) {
|
|
34
|
+
throw new Error(`Couldn't find a descriptor for route '${route.key}'.`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return render(descriptor.render());
|
|
31
38
|
};
|
|
32
39
|
|
|
33
|
-
|
|
34
|
-
ParamList
|
|
35
|
-
>(): TypedNavigator<{
|
|
36
|
-
ParamList: ParamList;
|
|
37
|
-
State: StackNavigationState<ParamList>;
|
|
38
|
-
ScreenOptions: {};
|
|
39
|
-
EventMap: {};
|
|
40
|
-
NavigationList: NavigationListBase<ParamList>;
|
|
40
|
+
interface StubStackTypeBag extends NavigatorTypeBagBase {
|
|
41
|
+
State: StackNavigationState<this['ParamList']>;
|
|
41
42
|
Navigator: typeof StackNavigator;
|
|
42
|
-
}> {
|
|
43
|
-
return createNavigatorFactory(StackNavigator)();
|
|
44
43
|
}
|
|
44
|
+
|
|
45
|
+
export const createStackNavigator =
|
|
46
|
+
createNavigatorFactory<StubStackTypeBag>(StackNavigator);
|