I am trying to rendering the value from API, i can see array if i console the values, but not able to see it from Flatlist.
API fetch line is here
i think this is where i am making mistakes
console output array
Help me please,
Well, you are doing Two things wrong here. Let's start with the first one which is the loading part.
NOTE: I WILL BE USING YOUR EXISTING FLATLIST PROPS AS ...otherProps.
<Flatlist
...otherProps
ListEmptyComponent={() => {
if(isLoading){
return <ActivityIndicator/>
}
}
/>
<Flatlist
...otherProps
extraData={data}
ListEmptyComponent={() => {
if(isLoading){
return <ActivityIndicator/>
}
}
/>
PS: you should really checkout the documentation for more information here https://reactnative.dev/docs/flatlist#listemptycomponent