skip to Main Content

Seo – How useEffect is called if there is a custom hook which is also using a use effect?

const [allrestro, setallrestro] = useState([]); const [filteredrestaurant, setfilteredrestaurant] = useState([]); const search = useState(""); [searchValue, setsearchValue] = search; useEffect(() => { const getRestaurants = async () => { const data = await fetch("https://www.swiggy.com/dapi/restaurants/list/v5?lat=30.9188442&lng=75.8148262&is-seo-homepage-enabled=true&page_type=DESKTOP_WEB_LISTING"); const json = await data.json(); setallrestro(json?.data?.cards[5]?.card?.card?.gridElements?.infoWithStyle?.restaurants); setfilteredrestaurant(json?.data?.cards[5]?.card?.card?.gridElements?.infoWithStyle?.restaurants);…

VIEW QUESTION
Back To Top
Search