I am trying to use React Navigation and StackNavigator to navigate around my app.
I have a button with onPress={() => navigate('DetailsScreen')
, and I was hoping that would take me to the DetailsScreen
, but I'm getting the following error:
E ReactNativeJS: undefined is not an object (evaluating 'this.props.navigation.navigate')
What do I need to add in order to get this working?
See my code here: https://gist.github.com/chapeljuice/bef4b0a4dedef2994c81f3634b81aa43