Created
November 13, 2019 05:35
-
-
Save aravi365/f0e505074567f6a9af0b704c569af4c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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