score:0

useEffect(() => {
    axios.get('https://texas-crm1.herokuapp.com/api/menus')
    .then(res => res.json())
    .then(data => {
    // do what ever you want with the data.  
    }).catch(error){
      console.log(error);
}

  
  },[])

score:0

the issue here:-
  setMenu(res => {
        return [
          {
          title: data.category,  //menu object is title but you call "name" at the component
          thumbanail: data.image,
          }
        ]
      })
//at the component
   <div className="main-title">{props.name}</div> // this should be {props.title}

Related Query

More Query from same tag