import {ActivityIndicator, FlatList, Text, View} from "react-native"; import {useState, useEffect} from "react"; export default function Page() { const [isLoading, setLoading] = useState(true); const [data, setData] = useState([]); const getProjects = () => { return fetch('http://192.168.178.129:1337/api/projects?populate=*') .then(response => response.json()) .then(json => { setData(json.data); setLoading(false) }) .catch(error => { console.error(error); }); }; useEffect(() => { getProjects(); }) return ( { isLoading ? ( ) : ( id} renderItem={({item}) => ( {item.attributes.name} )} /> ) } ) }