skip to Main Content

Reactjs – I'm getting an error: Effect callbacks are synchronous to prevent race conditions. I'm having trouble formatting it in the way it wants

I'm getting this error back though this same format seems to work in examples. const response = await axios.get('http://localhost:5000/get-tasks') const dataObject = response.data const arrayOfKeys = Object.keys(dataObject) const arrayOfData = Object.keys(dataObject).map((key) => dataObject[key]) console.log(arrayOfKeys) console.log(arrayOfData) }, [])```

VIEW QUESTION
Back To Top
Search