diff --git a/apps/common-app/package.json b/apps/common-app/package.json index 5778b89e732..b924363a1aa 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -36,10 +36,10 @@ "@react-native-community/slider": "^4.5.5", "@react-native-masked-view/masked-view": "^0.3.1", "@react-native-picker/picker": "^2.9.0", - "@react-navigation/bottom-tabs": "^6.6.1", - "@react-navigation/native": "^6.1.18", - "@react-navigation/native-stack": "^6.11.0", - "@react-navigation/stack": "^6.4.1", + "@react-navigation/bottom-tabs": "^7.0.0", + "@react-navigation/native": "^7.0.0", + "@react-navigation/native-stack": "^7.0.0", + "@react-navigation/stack": "^7.0.0", "@shopify/flash-list": "^1.7.1", "@stylexjs/babel-plugin": "^0.7.5", "@tsconfig/react-native": "^3.0.0", @@ -55,7 +55,7 @@ "react-native-pager-view": "^6.4.1", "react-native-reanimated": "workspace:*", "react-native-safe-area-context": "^4.13.1", - "react-native-screens": "3.35.0", + "react-native-screens": "^4.0.0", "react-native-svg": "^15.8.0", "react-strict-dom": "0.0.27", "typescript": "~5.3.0" diff --git a/apps/common-app/src/App.tsx b/apps/common-app/src/App.tsx index 52b6bdf5f53..16d1451c8bd 100644 --- a/apps/common-app/src/App.tsx +++ b/apps/common-app/src/App.tsx @@ -19,11 +19,7 @@ import type { HeaderBackButtonProps } from '@react-navigation/elements'; import { HeaderBackButton } from '@react-navigation/elements'; import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import type { - NavigationProp, - NavigationState, - PathConfigMap, -} from '@react-navigation/native'; +import type { NavigationState, PathConfigMap } from '@react-navigation/native'; import { NavigationContainer, useNavigation } from '@react-navigation/native'; import type { StackNavigationProp } from '@react-navigation/stack'; import { createStackNavigator } from '@react-navigation/stack'; @@ -168,10 +164,13 @@ const linking = { }; function BackButton(props: HeaderBackButtonProps) { - const navigation = useNavigation>(); + const navigation = useNavigation< + | StackNavigationProp + | NativeStackNavigationProp + >(); return ( - navigation.navigate('Home')} /> + navigation.popTo('Home')} /> ); } diff --git a/apps/common-app/src/examples/LayoutAnimations/LayoutTransitionExample.tsx b/apps/common-app/src/examples/LayoutAnimations/LayoutTransitionExample.tsx index 35959ae67f9..eb36fb162f3 100644 --- a/apps/common-app/src/examples/LayoutAnimations/LayoutTransitionExample.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/LayoutTransitionExample.tsx @@ -19,7 +19,10 @@ import Animated, { FlipOutYRight, } from 'react-native-reanimated'; import { createStackNavigator } from '@react-navigation/stack'; -import { NavigationContainer } from '@react-navigation/native'; +import { + NavigationContainer, + NavigationIndependentTree, +} from '@react-navigation/native'; import type { StackScreenProps } from '@react-navigation/stack'; interface Item { @@ -92,12 +95,14 @@ const Stack = createStackNavigator(); export default function Layout() { return ( - - - - - - + + + + + + + + ); } diff --git a/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx b/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx index 3c92240044a..9f2503ce476 100644 --- a/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx @@ -66,7 +66,7 @@ const App = ({ navigation.navigate('Home')}> + onPress={() => navigation.popTo('Home')}> Go back diff --git a/apps/common-app/src/examples/ScreenStackExample.tsx b/apps/common-app/src/examples/ScreenStackExample.tsx index f2910b59b32..7ae31d41c96 100644 --- a/apps/common-app/src/examples/ScreenStackExample.tsx +++ b/apps/common-app/src/examples/ScreenStackExample.tsx @@ -1,6 +1,10 @@ import * as React from 'react'; import { Button, StyleSheet, View } from 'react-native'; -import { NavigationContainer, useNavigation } from '@react-navigation/native'; +import { + NavigationContainer, + NavigationIndependentTree, + useNavigation, +} from '@react-navigation/native'; import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { @@ -60,12 +64,14 @@ function SecondScreen() { export default function ScreenStackExample() { return ( - - - - - - + + + + + + + + ); } diff --git a/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx b/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx index b190bc53646..1f7a36aa7cb 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx @@ -42,7 +42,7 @@ function Screen1({ navigation }: NativeStackScreenProps) { function Screen2({ navigation }: NativeStackScreenProps) { return ( -