我正在尝试使用库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, {...}
但是,没有人工作......有人可以解释我怎样才能使它有效?
谢谢 .