Reputation: 79
I have a text like this: User ID: 12345
I want to put it in only a text tag. <Text>UserID: 12345</Text>
But both part will be same style if I do that. So can we make only "UserID" bold?
Upvotes: 2
Views: 2534
Reputation: 677
sure you can use an other tag inside of your tag like this:
UserID: 12345
<Text><Text style={styles.bold}>UserID:</Text> 12345</Text>
var styles = StyleSheet.create({
bold: {
fontWeight: 'bold',
},
};
Upvotes: 1
Reputation: 22209
You can use nested Text
in order to do that
<Text>
<Text style={{ fontWeight: 'bold' }}>UserID:</Text>12345
</Text>
Upvotes: 9