I have a problem, I'm trying to get my room data from my API to use the map function after but I can't get the data. Here is my code.
Axios.get(`/user/rooms?${token}`).then(res => {
tmp.push(res.data)
})
const data = tmp
const Rooms = [data]
const RoomNames = []
And Here is the output after making console.log(data):
0: (4) [{…}, {…}, {…}, {…}]length: 1
__proto__: Array(0)
And data[0] is undefined