title: React mqtt subscription setState warning
body: <p>I'm using <a href="https://www.npmjs.com/package/mqtt" rel="nofollow">https://www.npmjs.com/package/mqtt</a> with React. In my component I have:</p>
  
  <pre><code>componentDidMount:function(){
  
          client.subscribe('test/topic');
          client.on('message',function(topic,message){
  
              if(topic==='test/topic'){
                  console.log(message.toString());
                  this.setState({value:parseInt(message.toString())});
  
  
              }
          }.bind(this));
  
      },
  componentWillUnmount:function(){
          client.unsubscribe('test/topic');
      },
  </code></pre>
  
  <p>So I subscribe to the topic when component will mount and unsubscribe when it unmounts. However, when i go to another view in my app and come back i get a warning with every mqtt message:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>What am i doing wrong?</p>