I am trying to fetch JSON data from this API: 'https://dog.ceo/api/breeds/list/all' I have tried several times even from official docs, but nothing helped , i am not getting error but nthing shows onn screen
useEffect(() => {
fetch('https://dog.ceo/api/breeds/list/all')
.then((response) => response.json())
.then((json) => setData(json.message))
.catch((error) => console.error(error))
.finally(() => setLoading(false));
}, []);
return (
<View style={{ flex: 1, padding: 24 }}>
{isLoading ? <ActivityIndicator/> : (
<FlatList
data={data}
keyExtractor={({ id }, index) => id}
renderItem={({ item }) => (
<Text>{item.message} ghbdt </Text>
)}
/>
)}
</View>