【发布时间】:2018-12-09 21:11:59
【问题描述】:
我正在尝试使用库 react-native-navigation v2,我需要一些帮助我被侧边菜单卡住了,我无法让它工作......
我这样初始化布局:
Navigation.events().registerAppLaunchedListener(() => {
Navigation.setRoot({
root: {
sideMenu: {
id: "sideMenu",
left: {
component: {
id: "Drawer",
name: "navigation.Drawer"
}
},
center: {
stack: {
id: "AppRoot",
children: [
{
component: {
id: "App",
name: "navigation.AppScreen"
}
}
]
}
}
}
}
});
});
有了之前注册的组件,并且在 Drawer 组件中我希望当用户点击该项目时,它会触发 goToScreen2(),
我试过了:
Navigation.setStackRoot(this.props.componentId, {...}
Navigation.mergeOptions(this.props.componentId, {...}
Navigation.push(this.props.componentId, {...}
但是,没有一个工作......有人可以解释我怎样才能让它工作?
谢谢。
【问题讨论】:
-
我会推荐你反应导航 v2
-
我已经知道 react ta navigation 但我想使用 react-native-navigation
标签: react-native react-native-navigation drawer side-menu