How to call Screen / Component class method from react-navigation Header

后端 未结 5 2061
死守一世寂寞
死守一世寂寞 2021-02-09 00:27

I need to call SearchScreen class method from a React Navigation Header.

The Navigator look like this:

  Search: {
    screen: SearchScreen,
    path: \'         


        
5条回答
  •  一整个雨季
    2021-02-09 00:49

    static navigationOptions =  ({navigation}) => {
    return {
     headerTitle: () => ,
     headerRight: () => (),
     headerTintColor:'black',
     headerStyle: {
       backgroundColor: '#6200EE'
     },
    }
    };
    
    this.props.navigation.setParams({ onPressSyncButton: this.updateUserProfile });
    

提交回复
热议问题