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

前端 未结 13 1723
说谎
说谎 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:39

    If you use TouchableOpacity/Height in your child element, pass it this.props.onPress like this:

    
    

    Then call the onPress function in your parent component like this:

    
    

提交回复
热议问题