Skip to content

Instantly share code, notes, and snippets.

@naishe
Last active Jul 21, 2020
Embed
What would you like to do?
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