you need use {'
'} as line breaks in text component, whenever you need to add line break in react native application
<Text>
Hi~{"
"}
this is a test message.
</Text>
<View style={styles.lineUnder}>
<Text>example text</Text>
</View>
const styles = StyleSheet.create({
lineUnder: {
borderBottomColor: 'black',
borderBottomWidth: 1,
}
});
text = text.replace(/<brs*/?>/gi, "
")