如何在侧边菜单中实现到其他页面的 Activity 链接?
我正在使用这个例子https://github.com/react-native-fellowship/react-native-side-menu/tree/master/examples/Basic在我的应用程序上,但是当我添加 TouchableOpacity
和 onPress
功能时
this.props.navigator.push({
name: 'Main'
});
我遇到错误“无法读取未定义的属性‘push’”。并且所有功能在侧边菜单打开时执行(在我按下按钮之前)。如何解决?
最佳答案
I had an error "Cannot read property 'push' of undefined".
你需要使用
<Menu navigator={this.props.navigator}/>
代替
<Menu/>
关于javascript - 如何在侧面菜单中使用 TouchableOpacity onPress?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35129098/