SongList.jsx 490 B

12345678910111213141516171819202122232425262728
  1. import React, { Component } from "react";
  2. import PropTypes from "prop-types";
  3. import { connect } from "react-redux";
  4. import SongItem from "./SongItem.jsx";
  5. export default class SongList extends Component {
  6. constructor(props) {
  7. super(props);
  8. }
  9. render() {
  10. const { callback, songs } = this.props;
  11. return (
  12. <ul>
  13. {
  14. songs.map((song) => {
  15. return (
  16. <SongItem key={ song.songId } song={ song } callback={ callback }/>
  17. );
  18. })
  19. }
  20. </ul>
  21. );
  22. }
  23. }