1 回答
TA贡献1818条经验 获得超3个赞
const data = [
{
students: [
{
name: "crystal",
city: "town",
number: 1
},
{
name: "barbra",
city: "street",
number: 2
}
]
}
];
class App extends Component {
render() {
console.log(data[0].students)
return (
<FlatList
data={data[0].students}
renderItem={({ item }) => {
return (
<View>
<View>
<Text style={{ fontSize: 16 }}>{item.name}{console.log(item)}</Text>
<Text style={{ fontSize: 16 }}>{item.city}</Text>
<Text style={{ fontSize: 16 }}>{item.number}</Text>
</View>
</View>
);
}}
/>
);
}
}
添加回答
举报