hr in react native code example
Example 1: horizontal line html react
const ColoredLine = ({ color }) => (
<hr
style={{
color: color,
backgroundColor: color,
height: 5
}}
/>
);
Example 2: line separator with text in the center react native
<View style={{flexDirection: 'row'}}>
<View style={{backgroundColor: 'black', height: 2, flex: 1, alignSelf: 'center'}} />
<Text style={{ alignSelf:'center', paddingHorizontal:5, fontSize: 24 }}>Your class</Text>
<View style={{backgroundColor: 'black', height: 2, flex: 1, alignSelf: 'center'}} />
</View>