首页 > 解决方案 > 当我像参数一样使用它时,类型路由是什么?

问题描述

我使用如下路线:

<Stack.Screen
 component={VacancyChat}
 name='VacancyChat'
 options={({ route }: any) => ({
   title: route?.params?.order.title,
 })}
/> 

我应该在这里使用什么类型的路线而不是任何路线?

标签: typescriptreact-nativereact-navigation

解决方案


这是 Stack.Screen 的类型option

    options?: ScreenOptions | ((props: {
        route: RouteProp<ParamList, RouteName>;
        navigation: any;
    }) => ScreenOptions);

推荐阅读