Commit a59d8bcc authored by XieZhiXiong's avatar XieZhiXiong

chore: 调整路由类型声明

parent bf96bbba
......@@ -2,7 +2,7 @@ import BottomTabs from './BottomTabs';
import TestDetailsScreen from '../views/Test/TestDetailsScreen';
export const ROUTERS = {
Home: {
BottomTabs: {
title: '首页',
component: BottomTabs,
},
......
......@@ -12,7 +12,7 @@ export type TabRouteType = React.ComponentProps<typeof Tab.Screen>;
export type StackRouteType = React.ComponentProps<typeof Stack.Screen>;
export type RootStackParamList = {
Home: { post: string },
BottomTabs: NavigatorScreenParams<RootTabParamList>;
TestDetailsScreen: undefined;
};
......@@ -20,7 +20,8 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
NativeStackScreenProps<RootStackParamList, Screen>;
export type RootTabParamList = {
Home: NavigatorScreenParams<RootStackParamList>;
// Home: NavigatorScreenParams<RootStackParamList>;
Home: { post: string };
Customer: undefined;
PWAS: undefined;
PersonalCenter: undefined;
......
......@@ -12,10 +12,9 @@ const TestDetailsScreen: React.FC<TestDetailsScreenNavigationProp> = ({ navigati
title="Go back"
onPress={() => {
// Pass and merge params back to home screen
navigation.navigate('Home', {
navigation.navigate('BottomTabs', {
screen: 'Home',
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