title: React function returns undefined
body: <p>I'm about two weeks into studying React and working on my first SPA.  I'm loving react and able to figure out many of my problems but I've run into two problems on this MusicPlayer component I'm making.</p>
  
  <p>One is that when I change src in my html audio element the actual audio doesn't change even though the src path does change.  I can see it happening in dev tools.  I can see the src change when a button is clicked, but the audio that is playing doesn't change.  If the audio track finishes it doesn't load the next track.  The audio that I hear is always track 1 regardless of what the src is.</p>
  
  <p>My other issue is that songBuilder() is returning undefined.  I can't find any bugs in my syntax though they must be there.  I used create-react-app as my boilerplate as I don't understand webpack in the slightest yet.  Is my map problem a deficit in my JS understanding or is something odd happening with the bundling/build?  Please let me know if more information is needed to answer this question.  Thank you!</p>
  
  <pre><code>import React, { Component } from "react";
  
  const songRepo = [
    {
      title: "The Silver Swan",
      songLength: "0:13",
      path: require("./songs/thesilverswan.mp3")
    },
    {
      title: "Miracle Cure",
      songLength: "0:12",
      path: require("./songs/miraclecure.mp3")
    },
    {
      title: "Miracle Cure",
      songLength: "0:12",
      path: require("./songs/miraclecure.mp3")
    },
    {
      title: "Miracle Cure",
      songLength: "0:12",
      path: require("./songs/miraclecure.mp3")
    }
  ];
  
  export default class MusicPlayer extends Component {
    constructor(props) {
      super(props);
      this.state = { count: 0 };
    }
  
    songBuilder() {
      return songRepo.map((song, index) =&gt; (
        &lt;li
          className={index % 2 === 0 ? "even song_wrapper" : "odd song_wrapper"}
        &gt;
          &lt;span className="song_number"&gt; {index + 1}&lt;/span&gt;
          &lt;span key={index + 1} className="song_title"&gt;
            {song.title}
          &lt;/span&gt;
          &lt;span className="song_length"&gt;{song.songLength}&lt;/span&gt;
        &lt;/li&gt;
      ));
    }
  
    playerClick(type) {
      if (type === "next_song" &amp;&amp; this.state.count &lt; songRepo.length - 1) {
        this.setState({ count: this.state.count + 1 });
      } else if (type === "prev_song" &amp;&amp; this.state.count &gt; 0) {
        this.setState({ count: this.state.count - 1 });
      }
    }
  
    render() {
      return (
        &lt;div className="player"&gt;
          &lt;div className="player_nav"&gt;
            &lt;div className="player_title"&gt;
              &lt;span className="song_number"&gt;{this.state.count + 1}&lt;/span&gt;
              &lt;span className="song_title"&gt;
                {songRepo[this.state.count].title}
              &lt;/span&gt;
              &lt;span className="song_length"&gt;
                {songRepo[this.state.count].songLength}
              &lt;/span&gt;
            &lt;/div&gt;
            &lt;audio className="waveform" controls="controls"&gt;
              &lt;source src={songRepo[this.state.count].path} type="audio/mp3" /&gt;
            &lt;/audio&gt;
            &lt;div className="player_buttons"&gt;
              &lt;span
                className="prev_song"
                onClick={this.playerClick.bind(this, "prev_song")}
              &gt;
                &amp;lsaquo;&amp;lsaquo;
              &lt;/span&gt;
              &lt;span&gt; &lt;/span&gt;
              &lt;span
                className="next_song"
                onClick={this.playerClick.bind(this, "next_song")}
              &gt;
                &amp;rsaquo;&amp;rsaquo;
              &lt;/span&gt;
            &lt;/div&gt;
            &lt;div&gt;
              &lt;ul className="song_list"&gt;{songBuilder()}&lt;/ul&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>