Jammming project help

I am at my wit’s end regarding this project. I was able to complete it before the React portion of the front-end course changed from class to function components, so I tried to convert the code to match. Currently, the search option is finicy as I have to reload the page a couple of times before the search function works. In addition, the site does not want to add tracks. Clicking on the + sign does nothing.

Hi. I looked at the addTrack function, I think maybe one of the errors y that you are directly mutating the state. I would recommend use the setter function like this:

if (playlistTracks.some((currentSong) => currentSong.id === track.id)){
return;
}
setPlaylistTracks((prevPlayListTracks) => […prevPlayListTracks, track])

The same applies for the removeTrack function.