Last active
July 21, 2020 07:00
-
-
Save naishe/5ef6f3feccb5ebd33ef411f98ef152a5 to your computer and use it in GitHub Desktop.
i18next App.tsx file
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 {SafeAreaView, StyleSheet, View, Text, StatusBar} from 'react-native'; | |
// Localization.ts code can be found here: https://gist.github.com/naishe/a6d9ea9d23214875ac176b63387ab833 | |
import './localization'; | |
import {useTranslation} from 'react-i18next'; | |
declare const global: {HermesInternal: null | {}}; | |
const App = () => { | |
const {t} = useTranslation(); | |
return ( | |
<> | |
<StatusBar barStyle="dark-content" /> | |
<SafeAreaView style={styles.main}> | |
<View> | |
<Text>{t('Welcome to React')}</Text> | |
</View> | |
</SafeAreaView> | |
</> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
main: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
}, | |
}); | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment