is there a difference between
useEffect(()=>{
async function fetchData(){
await axios
.get(path, config)
.then(resp=>console.log(resp))
.catch(error=>console.log(error))
}
fetchData();
},[])
&
useEffect(()=>{
axios
.get(path, config)
.then(resp=>console.log(resp))
.catch(error=>console.log(error))
},[])
is there one that is more recommended or one that is more depreciated than the other one?
in terms of results both give the same, the "async" is newer, but other than that is there something?
thanks,