Pass navigation.navigate to Child Component

后端 未结 6 1499
轻奢々
轻奢々 2021-02-09 16:32

Building an app using react-navigation. I have a parent component that pulls from firebase and renders data in a listview. The listview render component \'ListName\' has an onRo

6条回答
  •  旧巷少年郎
    2021-02-09 16:50

    import {withNavigation} from 'react-navigation';
    
    class Parent extends Component{
      
    }
    
    class Child extends Component {
      this.props.navigation.navigate("Screen")}>
        
         {PRESS ME}
        
      
    }
    
    export default withNavigation(Parent);
    

提交回复
热议问题