const [feed, setFeed] = useState([]); useEffect(() => { async function fetchData() { const response = await fetch( "https://www.sciencedaily.com/rss/earth_climate/environmental_issues.xml" ) .then((response) => response.text()) .then((responseData) => rssParser.parse(responseData)) .then((rss) => { // console.log(rss.items); setFeed(rss.items); }); } fetchData(); }, []);