typescript - 将 CompositeScreenProps 合并到 BottomTabScreenProps
问题描述
type HomeTabParamList = {
Chats: undefined;
Contacts: undefined;
Profile: undefined;
};
你如何合并
type ContactsScreenProps = CompositeScreenProps<
BottomTabScreenProps<HomeTabParamList, 'Contacts'>,
StackScreenProps<RootStackParamList>
>;
进入
export type HomeTabScreenProps<RouteName extends keyof HomeTabParamList> =
BottomTabScreenProps<HomeTabParamList, RouteName>;
?
我知道您也可以仅用ContactsScreenProps
作该屏幕的道具。只是想知道是否可以将其重新注入HomeTabScreenProps
以获得统一的 API
解决方案
推荐阅读
- mysql - Django 设置未获取用户
- flow-project - tutorial_06 中的错误:FileNotFoundError
- kubernetes - 如何修复 Py4JJavaError:调用 collectToPython 时出错
- google-cloud-platform - 带有 gmail 用户的项目的服务边界
- php - Laravel 中 morphs 列类型的用途是什么?
- google-sheets - 在只有日期和月份的单元格中添加年份(多个不同的年份)(Google 表格)
- powerapps - 有什么办法可以同时打开两个系统的应用程序吗?
- python - Python Bokeh,如何从多个图例中隐藏同一行
- javascript - 如何将图像添加到 JavaScript 中的随机变量?
- mysql - 优化 MySQL 中的 where 子句查询