I need to apply in a sentence two different fontFamily.
In the phrase "String1: second String", I need "string1:" to be semibold, and "second String" is regular.
<Text
style={[
{ color: colors.black, fontFamily: 'Montserrat-SemiBold' },
]}>
String1:
<Text
style={[
{ color: colors.black, fontFamily: 'Montserrat-Regular' },
]}>
second String
</Text>
</Text>
The result of the above code puts all text to semibold.
For this question I needed in React-Native to make a sentence have two different fontFamily. For this we created a to make the line of text and within that component we put the sentence divided with the different fontFamily. The end result is what is in the image, and the solution the code below.
Solution is...
<Text>
<Text
style={[
{ color: colors.black, fontFamily: 'Montserrat-SemiBold' },
]}>
String1:
</Text>
<Text
style={[
{ color: colors.black, fontFamily: 'Montserrat-Regular' },
]}>
second String
</Text>
</Text>