A playlist manager lets users type a song name and click Add Track to append it to the playlist.
Type a song name and click Add Track - a new row appears in the playlist but it is completely empty. The input clears correctly but the song name never shows up
The reducer receives everything the dispatch sends - are you reading the right field?
The reducer receives everything the dispatch sends - are you reading the right field?
Why this fixes it
The dispatch sent { type: "ADD", name: input } but the reducer read action.title, which was undefined — so every track was appended as an empty string. Changing action.title to action.name in the reducer reads the field that was actually dispatched, and the song name appears correctly.