Skip to content

Instantly share code, notes, and snippets.

@aloukissas
Created January 14, 2019 16:53
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 aloukissas/75213d6946ce1173d488e3addee8d7ce to your computer and use it in GitHub Desktop.
Save aloukissas/75213d6946ce1173d488e3addee8d7ce to your computer and use it in GitHub Desktop.
import React from "react";
import { View, Text, StyleSheet, Button } from "react-native";
import { Auth } from "aws-amplify";
import { withAuthContext } from "../context";
class Home extends React.Component {
handleLogout = async () => {
await Auth.signOut();
this.props.auth.setAuthenticated(false);
};
render() {
return (
<View style={styles.container}>
<Button title="Logout" onPress={this.handleLogout} />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center"
}
});
export default withAuthContext(Home);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment