Skip to content

Instantly share code, notes, and snippets.

@shinchit
Last active October 17, 2019 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinchit/bd33541391e76f39155f908da3a9a5a1 to your computer and use it in GitHub Desktop.
Save shinchit/bd33541391e76f39155f908da3a9a5a1 to your computer and use it in GitHub Desktop.
import React from 'react';
import {
TouchableHighlight,
View,
Text,
} from 'react-native';
import withCommonProps from './withCommonProps';
class SomeComponent extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
getLanguageCode,
navigateTo,
} = this.props;
// you can use getLanguageCode and navigateTo function you want.
const languageCode = getLanguageCode();
return {
<TouchableHighlight onPress={() => { navigateTo(['Home', 'Plan', 'PlansList']); }}>
<View>
<Text>Move to Home->Plan->PlansList</Text>
<Text>Your language code is {languageCode}.</Text>
</View>
</TouchableHighlight>
}
}
}
export default withCommonProps(SomeComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment