Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
Log out button in drawer navigation - React native

Im trying to implement a button Log out into the drawer navigation. I have the function signOut that I want to call when I clcik on the button Log out from the drawer navigation :

App.js :

 const AppHomeTeacherDrawerNavigator = createDrawerNavigator({
  Home: {
    screen: Home,
    navigationOptions: {
      title: "Menu",
      drawerIcon: () => <Icon name="home" size={25} />,
    },
  },

  SettingsScreen: {
    screen: SettingsScreen,
    navigationOptions: {
      title: "Log out",
      drawerIcon: () => <Icon name="settings" size={25} />,
    },
  },
}); 

SettingsScreen.js :

export default class SettingsScreen extends React.Component {
  signOut = async () => {
    try {
      await firebase.auth().signOut();
      this.props.navigation.navigate("WelcomeScreen");
    } catch (error) {
      Alert.alert("", "");
    }
  };


  render() {
    return (
      <View>
       <CustomValidationButton onPress={this.signOut}>
              <Text>Log out</Text>
            </CustomValidationButton>
      </View>  
    );
  }
}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!