Created
December 12, 2017 06:52
-
-
Save imballinst/e19611e4c801f190b0fb1f46a12eb6c9 to your computer and use it in GitHub Desktop.
React Native with and without StyleSheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View, Text, StyleSheet } from 'react-native'; | |
const styleObject = { fontSize: 24 }; | |
const styles = StyleSheet({ | |
textStyle: styleObject, | |
}); | |
const AnElement = () => ( | |
<View> | |
<Text style={styleObject}>Hi!</Text> | |
<Text style={styles.textStyle}>Hi too!</Text> | |
</View> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment