我有一个我无法解决的问题. 我有一串对象,而它又有另一串对象
const data = [
{
title: 'Medical',
data: [{
notice: 'Test 1',
documentType: 'Medical',
file: 'https://test.1'
}],
}
];
我try 根据标题在滚动视图组件中加载这些项目
<View>
<Header title={PERSONAL_INFO}/>
<Center>
<ScrollView w={["200", "300"]} h="80">
{data.map((item, index) => (
(<View>
<Center>
<Heading>
{item.title}
</Heading>
{
data[index].data.map((item) =>
<Text>{item.notice}</Text>
)
}
</Center>
</View>)
))}
</ScrollView>
</Center>
</View>
在只有一个条件的情况下,一切都正确加载,我会收到一个无法摆脱的警告.
Warning: Each child in a list should have a unique "key" prop.