#Cannot read properties of undefined - API Working | Pagination

27 messages ยท Page 1 of 1 (latest)

dusk verge
#

Can someone help me with this?

dusk verge
dusk verge
#

or ur not using api correctly

#

this isn't the first time i use this api

#

i use this api always like this

#

it uses strapi

dusk verge
#

so issue is at api

#

or ur not calling perfectly

#

this is very strange

#

See? the api works

dusk verge
#

data have empty array thats why its undefined

#

u have to catch error there

#

do

#

{api.data?.map(item => <div key={item.id}>{item.game_name}</div>)}

#

place a question mark there

#

after data

#

and try

#

alriight, same error

dusk verge
dusk verge
dusk verge
#

Swr is not fetching data properly try to use normal fetch or axios