Skip to content
Advertisement

I am passing a prop from App.js to MovieCard.js but props passed is showing empty

Complete github link -: https://github.com/dhruv354/movie-app.git

My App.js

In App.js i am using Map function to iterate over data file which is a array of objects and passing each object as a prop to Moviecard but it is showing empty

JavaScript

My MovieCard.js

In Moviecard i am receving movie object as a prop , i tried console logging but it is showing empty

JavaScript

my Data.js

this is a array of objects which is having information about a Movie like Plot, title, imdb and its Poster

JavaScript

Please help

Advertisement

Answer

Well inside your map function you are returning an empty string each time:

JavaScript

U should return the JSX instead:

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