Skip to content

Instantly share code, notes, and snippets.

@ide
Last active February 24, 2016 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ide/bed6675333e97046d571 to your computer and use it in GitHub Desktop.
Save ide/bed6675333e97046d571 to your computer and use it in GitHub Desktop.
Simple example of an ExRoute object
let homeRoute = {
getSceneClass() {
return require('./HomeScreen');
},
getTitle() {
return 'Home',
},
renderLeftButton(navigator) {
return (
<TouchableOpacity
touchRetentionOffset={ExNavigator.Styles.barButtonTouchRetentionOffset}
onPress={() => navigator.push(getSettingsRoute())}
style={ExNavigator.Styles.barLeftButton}>
<Text style={ExNavigator.Styles.barLeftButtonText}>Settings<Text/>
</TouchableOpacity>
);
},
renderRightButton(navigator) {
return (
<TouchableOpacity
touchRetentionOffset={ExNavigator.Styles.barButtonTouchRetentionOffset}
onPress={() => navigator.push(getHelpRoute())}
style={ExNavigator.Styles.barRightButton}>
<Text style={ExNavigator.Styles.barRightButtonText}>Help<Text/>
</TouchableOpacity>
);
},
configureScene() {
return ExNavigator.SceneConfigs.FloatFromRight;
},
};
@joshuapinter
Copy link

Typo on lines 16 and 27. Should be </Text> instead of <Text/>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment