Skip to content
Advertisement

TypeError: Cannot read property ‘map’ of undefined when I am trying to access API call data

I am trying to make a movie search app with React and have made an API call to The Movie Database API. I have this form and what I am trying to do is get the data of the movie that I am searching for.

I am not able to access the data from the API call, and I get this error of “Uncaught TypeError: Cannot read property ‘map’ of undefined”

I have two js files: 1 index.js

JavaScript

The second file is searchMovies.js

JavaScript

Can somebody tell me what I am doing wrong here? I am new to React. Many thanks!

Advertisement

Answer

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement