React native text like span
you can do as nesting text as text inside will consider as span like html
<View style={styles.contentView}>
<Text style={styles.content}><Text style={styles.username}>{s_username}</Text> {s_content}</Text>
</View>
contentView: {
paddingLeft: 10,
flex: 1,
},
username: {
fontWeight: 'bold'
},
content: {
},
React Native supports nested Text
components, and you must use this to get your desired result. For example, you should have your second text component nested within your second, like so:
<View style={styles.contentView}>
<Text>
<Text style={styles.username}
onPress={() => {/*SOME FUNCTION*/} >
{s_username}
</Text>
<Text style={styles.content}>{s_content}</Text>
</Text>
</View>