Skip to content
Advertisement

undefined is not an object (evaluating ‘this.props.navigation.navigate’) – React Native

I am trying to make my first React Native Android app and I am getting this error:

undefined is not an object (evaluating ‘this.props.navigation.navigate’)

This is the code:

JavaScript

I can not figure out why the error is coming.

Advertisement

Answer

You are exporting the component wrong. You should get rid of the export default on your class HomeScreen definition and at the bottom of the file do export default App;

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement