setAgent
useEffect(() => { async function fetchData() { const response = await fetch(`https://randomuser.me/api/?results=10`); const data = await response.json(); const [item] = data.results; setAgent(item); console.log(item); } fetchData(); },[]);
setAgent(data);
data
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)