title: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op
body: <pre class="lang-js prettyprint-override"><code>componentDidMount(prevProps, prevState, prevContext) {
      let [audioNode, songLen] = [this.refs.audio, List.length-1];
  
      audioNode.addEventListener('ended', () =&gt; {
          this._endedPlay(songLen, () =&gt; {
              this._currSong(this.state.songIndex);
              this._Play(audioNode);
          });
      });
  
      audioNode.addEventListener('timeupdate', () =&gt; {
          let [remainTime, remainTimeMin, remainTimeSec, remainTimeInfo] = [];
  
          if(!isNaN(audioNode.duration)) {
              remainTime = audioNode.duration - audioNode.currentTime;
              remainTimeMin = parseInt(remainTime/60);  // 剩余分
              remainTimeSec = parseInt(remainTime%60);  // 剩余秒
  
              if(remainTimeSec &lt; 10) {
                  remainTimeSec = '0'+remainTimeSec;
              }
              remainTimeInfo = remainTimeMin + ':' + remainTimeSec;
              this.setState({'time': remainTimeInfo});
          }
      });
  }
  
  componentWillUnmount () {
      let audio = this.refs.audio;
      audio.removeEventListener('timeupdate');
      audio.removeEventListener('ended');
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>Warning: setState(...): Can only update a mounted or mounting
    component. This usually means you called setState() on an unmounted
    component. This is a no-op. Please check the code for the undefined
    component.</p>
  </blockquote>
  
  <p>I removeEventListener 'ended' in <code>componentWillUnmount</code>, but it is not working. because I add <code>this.setState({'time': remainTimeInfo});</code> in <code>componentDidMount</code>.</p>