Skip to content

Instantly share code, notes, and snippets.

@BrodaNoel
Created January 19, 2019 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrodaNoel/0b82bbcd2a442fa2692c6a7c7b7cbb34 to your computer and use it in GitHub Desktop.
Save BrodaNoel/0b82bbcd2a442fa2692c6a7c7b7cbb34 to your computer and use it in GitHub Desktop.
import React from 'react';
import { View, TouchableOpacity } from 'react-native';
import duix from 'duix';
class Home extends React.Component {
onLogOutClick = () => {
// here you do something to logout the user
// ...
// then redirect to the Login page again
duix.set('currentPage', 'Login');
};
render() {
return (
<View style={[{ flex: 1 }]}>
<TouchableOpacity onPress={this.onLogOutClick}>
<View>
<Text>Log Out</Text>
</View>
</TouchableOpacity>
</View>
);
}
}
export default Home;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment