So I'm using Flatlist and I use data from an array and I'm showing it on my screen. And here is what I am getting at.
I want my output to be like the one shown in the red box.
Here is my code.
_renderItem (item) {
return(
<View style={{ width: 350, flexGrow: 1, }}>
<Text style={{ fontSize: 16, color: 'black', }}>
{item.law_practice_description} , // item.law_practice_description shows me the text like Administrative Adjudications etc
</Text>
</View>
);
}
render() {
return (
<View style={{ flex: 1 }}>
<Text style={styles.titleTxt}>Administrative Law</Text>
<FlatList
style={{ marginTop: 20,}}
data={this.state.data}
renderItem={({item}) => this._renderItem(item) }
keyExtractor={(index) => index.toString()}
/>
</View>
);
}
}