Skip to content

Instantly share code, notes, and snippets.

@naishe
Last active July 21, 2020 07:00
Show Gist options
  • Save naishe/5ef6f3feccb5ebd33ef411f98ef152a5 to your computer and use it in GitHub Desktop.
Save naishe/5ef6f3feccb5ebd33ef411f98ef152a5 to your computer and use it in GitHub Desktop.
i18next App.tsx file
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