Creating and using the songs list component

For now, we have simply displayed the list of songs within the Home view, but this isn't great. We should actually create a dedicated component to do that. What we actually want is a component that we can pass the list of songs to, which will render it nicely and let us know when a selection has been made in that list.

Here are the specifications for the SongsList component:

  • Accept an array of Song objects as input.
  • Accept a loading state boolean as input (which will be used to render the loading indicator when needed).
  • Display the provided list of songs; each item should be clickable.
  • Emit an event whenever a song in the list has been clicked upon; attach the corresponding Song object to the event. ...

Get Learn TypeScript 3 by Building Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.