useEffect() hook problem ,array based on fetch api is not populated – Reactjs
function RecipesList() { //use effect to useEffect(() => { const getRecipesList = async () => { const response = await fetch("http://localhost:4000/recipe/allrecipes", { method: "GET", }); const json = await response.json(); if (response.ok) { setData(json); const allCategories = [ "all", ...new…