I couldn't understand why it is not working. It is showing me error cannot find name 'contentItem'. Any suggestions ?
const CONTENT = [
{
title: 'Лицевой счет 256215492543',
sub_title: 'ул.Неизвестная, 78/9,',
count: true
},
{
title: 'Лицевой счет 12356215492543',
sub_title: 'ул.Неизвестная, 72/7,',
count: false
},
....
renderContent(section, _, isActive, CONTENT) {
return (
CONTENT.map(contentItem => (
if (contentItem.special) {
return(
<View>
<Text>{contentItem.title} spec</Text>
</View>
)
}
return(
<View style={{backgroundColor:'red'}}>
<Text>{contentItem.sub_title} </Text>
</View>
)
});
Basic idea, is to show TITLE if "count" is TRUE, if "count" false show SUB_TITLE