how to display a data after fetch response useeffect code example
Example: how to fetch data with useEffect
useEffect(() => {
const fetchData = async () => {
const result = await fetch(
'https://my-api.com',
);
setState(result);
};
fetchData();
}, []);