Skip to content

REACT: Erro ao chamar Dados da API #43847

Discussion options

You must be logged in to vote

Olhando o erro, ele ocorre na declaração do JSX onde você vai mostrar a imagem do pokemon, pois ele tenta acessar o atributo front_default dentro do atributo sprites que está sem valor definido.


Coloque um debugger na linha setLoading(false) e veja se o atributo sprites está com valor dentro do objeto do state pokemon.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by northonTV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working correctly API and Webhooks Discussions and conversations related to APIs or Webhooks
2 participants