-
-
Save agustinfece/11aa7650a9d64c3f8a01446b16cd71bd to your computer and use it in GitHub Desktop.
App.js
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 { StatusBar } from 'expo-status-bar'; | |
import React, { useEffect } from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import AsyncStorage from '@react-native-async-storage/async-storage'; | |
export default function App() { | |
const getTheme = async () => { | |
try { | |
const value = await AsyncStorage.getItem('theme'); | |
console.log('value', value); | |
} catch(error) { | |
console.log('error', error); | |
}; | |
}; | |
useEffect(() => { | |
getTheme(); | |
}, []); | |
return ( | |
<View style={styles.container}> | |
<Text>Open up App.js to start working on your app!</Text> | |
<StatusBar style="auto" /> | |
</View> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#fff', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment