【发布时间】:2017-05-17 15:34:10
【问题描述】:
我正在尝试使用 React Navigation 和 StackNavigator 在我的应用中导航。
我有一个带有onPress={() => navigate('DetailsScreen') 的按钮,我希望它可以将我带到DetailsScreen,但我收到以下错误:
E ReactNativeJS: undefined is not an object (evalating 'this.props.navigation.navigate')
我需要添加什么才能使其正常工作?
在这里查看我的代码: https://gist.github.com/chapeljuice/bef4b0a4dedef2994c81f3634b81aa43
【问题讨论】:
标签: javascript reactjs react-native undefined react-navigation