Commit a59d8bcc authored by XieZhiXiong's avatar XieZhiXiong

chore: 调整路由类型声明

parent bf96bbba
...@@ -2,7 +2,7 @@ import BottomTabs from './BottomTabs'; ...@@ -2,7 +2,7 @@ import BottomTabs from './BottomTabs';
import TestDetailsScreen from '../views/Test/TestDetailsScreen'; import TestDetailsScreen from '../views/Test/TestDetailsScreen';
export const ROUTERS = { export const ROUTERS = {
Home: { BottomTabs: {
title: '首页', title: '首页',
component: BottomTabs, component: BottomTabs,
}, },
......
...@@ -12,7 +12,7 @@ export type TabRouteType = React.ComponentProps<typeof Tab.Screen>; ...@@ -12,7 +12,7 @@ export type TabRouteType = React.ComponentProps<typeof Tab.Screen>;
export type StackRouteType = React.ComponentProps<typeof Stack.Screen>; export type StackRouteType = React.ComponentProps<typeof Stack.Screen>;
export type RootStackParamList = { export type RootStackParamList = {
Home: { post: string }, BottomTabs: NavigatorScreenParams<RootTabParamList>;
TestDetailsScreen: undefined; TestDetailsScreen: undefined;
}; };
...@@ -20,7 +20,8 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> = ...@@ -20,7 +20,8 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
NativeStackScreenProps<RootStackParamList, Screen>; NativeStackScreenProps<RootStackParamList, Screen>;
export type RootTabParamList = { export type RootTabParamList = {
Home: NavigatorScreenParams<RootStackParamList>; // Home: NavigatorScreenParams<RootStackParamList>;
Home: { post: string };
Customer: undefined; Customer: undefined;
PWAS: undefined; PWAS: undefined;
PersonalCenter: undefined; PersonalCenter: undefined;
......
...@@ -12,10 +12,9 @@ const TestDetailsScreen: React.FC<TestDetailsScreenNavigationProp> = ({ navigati ...@@ -12,10 +12,9 @@ const TestDetailsScreen: React.FC<TestDetailsScreenNavigationProp> = ({ navigati
title="Go back" title="Go back"
onPress={() => { onPress={() => {
// Pass and merge params back to home screen // Pass and merge params back to home screen
navigation.navigate('Home', { navigation.navigate('BottomTabs', {
screen: 'Home', screen: 'Home',
params: { post: 'postText' }, params: { post: 'postText' },
merge: true,
}); });
}} }}
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment