Hello
I’m having a problem with this project.
When I write a map functin to this.props.tracks I get an error “Cannot read property ‘map’ of undefined”.
tracks is defined as a prop to TrackList in searchresults.js… why is it undefined ?
Thank you
Hello
I’m having a problem with this project.
When I write a map functin to this.props.tracks I get an error “Cannot read property ‘map’ of undefined”.
tracks is defined as a prop to TrackList in searchresults.js… why is it undefined ?
Thank you
Not sure if you are still stuck on this or not, but I had a similar issue. It’s probably not that you didn’t define tracks, but that whatever function is supposed to set the values for tracks isn’t doing its job properly. So the tracks array is probably empty, which is causing the map function to freak out. Try logging tracks to the console or use the react component debugger to see what its actual value is.
Hey, do you still need help with this project? We’d need to see your code and the full code error (which should reference the line the error occurs) to be able to help troubleshoot it with you.
Here’s some tips from the community guidelines regarding getting help:
✓ Do format your code before posting.
✘ Don’t ask for help on an exercise without posting code.