RN(5) Style

Style

import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
class MyFirstReactNativeProject extends Component {
render() {
return (
<View>
<Text style={styles.justRed}>just red text</Text>
<Text style={styles.bigGreen}>just big green text</Text>
<Text style={[styles.bigGreen, styles.justRed]}>big green then red text</Text>
<Text style={[styles.justRed, styles.bigGreen]}>red then big green text</Text>
</View>
);
}
}
const styles = StyleSheet.create({
bigGreen : {
color : '#00ff00',
fontWeight : 'bold',
fontSize : 25
},
justRed : {
color : 'red',
},
});
AppRegistry.registerComponent('MyFirstReactNativeProject', () => MyFirstReactNativeProject);

More info about Text style: Text component reference

20:15:56.jpg