I have already solved this problem, but I don’t know why it works… When I use Async/Await the error persists
const [data, setData]= useState([])
const thisComponent = useRef(true)
useEffect(async()=>{
const http = axios()
const {data:{restaurants}}= await http.get('/restaurants')
if(thisComponent.current){
setData(restaurants)
}
return ()=>{
thisComponent.current=false
}
},[])