Удалить плоский список из кода:
Замените ваш метод рендеринга следующим кодом:
constructor(props) {
super(props)
this.state = {
data: [{ law_practice_description: 'Administration Administration' },
{ law_practice_description: 'Administration Agency Prctice' },
{ law_practice_description: 'Administration hearing and appeals' },
{ law_practice_description: 'Administration Administration' },
{ law_practice_description: 'Administration Agency Prctice' },
{ law_practice_description: 'Administration hearing and appeals' },
{ law_practice_description: 'Administration Administration' },
{ law_practice_description: 'Administration Agency Prctice' },
{ law_practice_description: 'Administration hearing and appeals' }],
};
}
render() {
let str = ''
this.state.data.map((item, index) => {
if (index == 0) {
str = item.law_practice_description
} else {
str = str + ', ' + item.law_practice_description
}
})
return (
<View style={{ flex: 1 }} >
<Text style={styles.titleTxt}>Administrative Law</Text>
<Text style={{ fontSize: 16, color: 'black', }}>
{str}
</Text>
</ View>
);
}