I am trying to display review information from the Zomato API
however for some reason nothing is being displayed.
I am using a FlatList
to put it all out there, but every time I compile the code nothing seems to show up.
Here is all my code regarding the subject:
<Text>REVIEWS:</Text>
{this.state.data.all_reviews_count == 0 ?
<View style={{ flex: 1, padding: 20, marginTop:0}}>
<Text style={{ color: '#000', fontWeight: 'bold' }}>No reviews for this restaurant yet</Text>
</View> :
<FlatList
keyExtractor={item => item.id}
showsVerticalScrollIndicator={false}
data={this.state.data}
renderItem={({ item }) =>
<View>
<Text>{item.all_reviews_count}</Text>
</View>}/>}
I have other data being retrieved and it's all being outputted just fine. for some reason the review section seems to be weird.
I also checked to see how reviews are displayed in the terminal
and this is what I got:
"all_reviews": Object {
"reviews": Array [
Object {
"review": Array [],
},
Object {
"review": Array [],
},
Object {
"review": Array [],
},
Object {
"review": Array [],
},
Object {
"review": Array [],
},
],
}
hopefully somebody with experience with the Zomato Api can help me out