I've tried react-native-hr package - doesn't work for me nor on Android nor on iOS.
Following code is also not suitable because it renders three dots at the end
<Text numberOfLines={1}}>
______________________________________________________________
</Text>
Creating a reusable
Line
component worked for me:Now, Import and use
Line
anywhere:This is in React Native (JSX) code, updated to today:
you can use either
alignSelf:'stretch'
orwidth: "100%"
both should work... and,here
StyleSheet.hairlineWidth
is the thinnest, then,and so on to increase thickness of the line.
This is how i solved divider with horizontal lines and text in the midddle:
And styles for this:
Just create a View component which has small height.
I did it like this. Hope this helps
for style: