font weight react native code example

Example 1: react-native italics

<Text style={styles.bold}>I'm bold!</Text>
<Text style={styles.italic}>I'm italic!</Text>
<Text style={styles.underline}>I'm underlined!</Text>

const styles = StyleSheet.create({
    bold: {fontWeight: 'bold'},
    italic: {fontStyle: 'italic'},
    underline: {textDecorationLine: 'underline'}
})

Example 2: react native text wrap

<View
    style={{ flexDirection: 'row' }}
> 
   <Text style={{ flexShrink: 1 }}>
       Really really long text...
   </Text>
</View>

Example 3: font weight react native

subWarningText: {
    color: '#5460C8',
    fontWeight: Platform.OS === 'android' ? 'normal' : '400',
    fontSize: 14 / fontScale,
    marginLeft: scaleWidth(24),
    marginRight: scaleWidth(10),
    marginBottom: scaleHeight(276),
  },

Tags:

Css Example