Getting undefined is not an object evaluating _this.props.navigation

前端 未结 13 1651
说谎
说谎 2020-12-14 15:19

I\'m using DrawerNavigator and I have 3 pages: Router page, mainScreen and a photos page,
I maked a header navbar are

相关标签:
13条回答
  • 2020-12-14 15:55

    class ProductScreen extends Component {

    export default ProductScreen; // make sure bottom this line mention

    Call this

      <TouchableOpacity
            onPress = {() => this.props.navigation.navigate('ProductAddScreen')}
            activeOpacity={0.7} style={styles.button}>
    
           <Text style={styles.message}>{this.state.notFound} </Text>
    
      </TouchableOpacity>
    
    0 讨论(0)
提交回复
热议问题