Jammming: track button doesn't add track to playlist

Hi!

I can’t seem to get a track to actually add to the playlist. I followed the walkthrough video and my code looks the same (there’s probably something off, but I’m not sure where. I wish we could download a solution?). I’m not getting any errors, but when I click on the + nothing happens.

In dev tools I see the function is bound to the button and all the parent components. Any ideas?

Here’s a link to my code on Github. (I called it Reactify instead of Jammming because that’s just too cheesy!)

Hello!

There are at least two issues in your code:

  1. The first problem is in your source data for searchResults and playlistTracks. They contain tracks with equal ids, so when method App.addTrack runs it skips adding by condition tracks.find(savedTrack => savedTrack.id === track.id). Make different ids for tracks in searchResults and playlistTracks.
  2. The second issue, not related to the first one, is using class instead of className in App jsx for one of the divs.

Fix these issues and test your app again.

1 Like

Thanks so much! I’ll give it a shot!

That solved it! Thanks again.