在使用NavigationStackScreenComponent类型注释对屏幕组件进行类型检查时,如何合并组件道具的类型注释?

以下是版本4.x的React Navigation文档中可用的示例

import { NavigationStackScreenComponent } from 'react-navigation-stack';

type Params = { userId: string };

type ScreenProps = { language: string };

const ProfileScreen: NavigationStackScreenComponent<
  Params,ScreenProps
> = props => {
  // ...
};

ProfileScreen.navigationOptions = {
  headerTitle: 'Profile',};

在打字稿世界中我仍然是菜鸟,但试图使其适应我的React Native Projects。 我遇到的问题是NavigationStackScreenComponent泛型接受导航参数和screenProps的类型,但是我无法(也许有,但我找不到它!)为组件prop添加类型注释。1 >

kankan07 回答:在使用NavigationStackScreenComponent类型注释对屏幕组件进行类型检查时,如何合并组件道具的类型注释?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3159260.html

大家都在问