When i refresh the page, my object is empty but when i go back in the code, change something and save it, the request is made again, with no refresh, successfuly and contain the expected result.
const [specialities, setSpecialities] = useState([])
const getData = async ()=> {
await axios.get(getURL).then((response)=>{
setSpecialities(response.data)
console.log(specialities, "specialeties are displayed here")
})
}
useEffect(()=>{
getData()
}, [])```
Here i remove the accolades in my useEffect and it works, my response is full when i reload but the request is made infinitely.
const [specialities, setSpecialities] = useState([])
const getData = async ()=> {
await axios.get(getURL).then((response)=>{
setSpecialities(response.data)
console.log(specialities, "specialesss")
})}
useEffect(()=>{
getData()
})