我在https://reactnavigation.org/docs/navigators/drawer 中使用 DrawerNavigator 。
const MyApp = DrawerNavigator({
Home: {
screen: MyHomeScreen,
},
Notifications: {
screen: MyNotificationsScreen,
},
});
我有多个屏幕使用MyNotificationsScreen
具有不同props的组件。
我该怎么做:
const MyApp = DrawerNavigator({
Home: {
screen: MyHomeScreen,
},
Notifications1: {
screen: MyNotificationsScreen(propName=val1),
},
Notifications2: {
screen: MyNotificationsScreen(propName=val2),
},
});