Reputation: 830
I do have such kind of JSON. I am getting it on my React Native app.
order:[
{
"id": "00005497",
"order_number": "525522",
"order_result_json": [
{
"key": "Номер",
"value": "25263640253590"
},
{
"key": "Ссылка на скачивание",
"value": "https://play.google.com/store/"
},
{
"key": "Ссылка на лицензию",
"value": "https://google.com"
}
]
}]
I can see that data is coming: alert(JSON.stringify(order.orderResultJson)); this is showing that array is coming.
When I am applying it to my FlatList, it is showing empty space, and if I scrolling page down it is going infinite scroll with empty content.
My FlatList implementation:
<View style={{flex: 1, backgroundColor: 'green'}}>
<FlatList
data={order.orderResult}
renderItem={({item}) => <Text>{item.value}+5</Text>}
keyExtractor={item => item.key}
/>
</View>
Any suggestions?
Upvotes: 1
Views: 135
Reputation: 1101
order is an array, so you cannot access order.orderResult.
2 solutions :
Upvotes: 0
Reputation: 1625
Isn't just a typo?
Your code uses data={order.orderResult}
, but your json data contains order_result_json
, and your debugging code with alert uses orderResultJson
Upvotes: 2