React.useEffect(function() {
console.log("Effect ran")
fetch("https://swapi.dev/api/people/1")
.then(res => res.json())
.then(data => setStarWarsData(data))
}, [])
fetch("https://catfact.ninja/fact")
.then((res) => res.json())
.then((data) => {
console.log(data);
});
fetch("https://catfact.ninja/fact")
.then((res) => res.json())
.then((data) => {
console.log(data);
});
import React, {useEffect} from 'react';
useEffect(() => {
getRecipes();
}, []);
const getRecipes = async () => {
const response = await fetch(
`https://........`
);
const data = await response.json();
console.log(data);