Skip to content

Instantly share code, notes, and snippets.

@aravi365
Created November 13, 2019 05:35
Show Gist options
  • Save aravi365/f0e505074567f6a9af0b704c569af4c3 to your computer and use it in GitHub Desktop.
Save aravi365/f0e505074567f6a9af0b704c569af4c3 to your computer and use it in GitHub Desktop.
import React from 'react';
import {StyleSheet, Platform, Image, Text, View} from 'react-native';
import firebase from 'react-native-firebase';
export default class Home extends React.Component {
state = {currentUser: null};
componentDidMount() {
const {currentUser} = firebase.auth();
this.setState({currentUser});
}
render() {
const {currentUser} = this.state;
return (
<View style={styles.container}>
<Text style={{fontSize: 25}}>Hi </Text>
<Text style={{color: 'blue', fontSize: 25}}>
{currentUser && currentUser.email}
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment