score:2

this means that newsdata is not an array. considering that you initialized it as an empty array (const [newsdata, setnewsdata] = usestate([]);) i think that your problem is here:

setnewsdata(res)

res is not an array.

to solve this you should set newsdata as:

setnewsdata(res.data)

Related Query

More Query from same tag