【问题标题】:What is type route when I use it like param?当我像参数一样使用它时,类型路由是什么?
【发布时间】:2020-11-20 12:54:54
【问题描述】:

我使用如下路线:

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

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

【问题讨论】:

    标签: typescript react-native react-navigation


    【解决方案1】:

    这是 Stack.Screen option 的类型:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多