Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentWillMount() {
- AsyncStorage.getItem('language', (err, result) => {
- langCode = result;
- this.setState({
- currLang: result,
- })
- });
- }
- onLangChange(value, index){
- Config.langCode = value;
- this.setState({ currLang: Config.langCode });
- AsyncStorage.setItem('language', value)
- console.log( 'here is your new lang ' + Config.langCode);
- }
- render(){
- const {navigate} = this.props.navigation;
- const {goBack} = this.props.navigation
- const langText = Config.langText[this.state.currLang]; // Object that has text in current language.
- return(
- <ScrollView style={styles.mainContainer}>
- <View style={styles.headerContainer}>
- <View style={styles.iconContainer}>
- <TouchableOpacity onPress={ () => goBack('') } >
- <Image source={Config.images.leftArrowIcon} style={styles.leftArrowIcon} />
- </TouchableOpacity>
Add Comment
Please, Sign In to add comment