Skip to content

Instantly share code, notes, and snippets.

@ridgeO
Created May 30, 2017 03:44
Show Gist options
  • Save ridgeO/f81e79c1957a0f035f4006d32145a5cc to your computer and use it in GitHub Desktop.
Save ridgeO/f81e79c1957a0f035f4006d32145a5cc to your computer and use it in GitHub Desktop.
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
class GreenScreen extends Component {
render() {
return(
<View style={styles.green}>
<Text style={styles.text}>This is the Green Screen</Text>
</View>
);
}
}
class RedScreen extends Component {
render() {
return(
<View style={styles.red}>
<Text style={styles.text}>This is the Red Screen</Text>
</View>
);
}
}
class BlueScreen extends Component {
render() {
return(
<View style={styles.blue}>
<Text style={styles.text}>This is the Blue Screen</Text>
</View>
);
}
}
class PurpleScreen extends Component {
render() {
return(
<View style={styles.purple}>
<Text style={styles.text}>This is the Purple Screen</Text>
</View>
);
}
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment