Я пытаюсь показать список в react native. Я хочу, чтобы последний дочерний элемент в списке выглядел по-другому, но я не могу выбрать его.
У меня есть работа с массивом, которую я oop выполняю.
this.state.chores.map((chore, i) => {
const style = EStyleSheet.child(styles, 'card', i, this.state.chores.length);
return (
<Card title={chore.name} key={i} style={style}>
<Text>{chore.desc}</Text>
</Card>
)
})
EStyleSheet.build()
const styles = EStyleSheet.create({
card: {
paddingBottom: '10rem',
},
'card:last-child': {
backgroundColor: '#a84ca2',
}
});
Любая помощь приветствуется.