title: react and socket io private messaging not working
body: <p>server side </p>
  
  <pre><code> io.on('connection', function(socket){
  
    socket.on('user joined', function(data){
       socket.join(data.username);    
    });
  
    socket.on('disconnect', function(){
      console.log('user disconnected');
    });
  
    socket.on('send private', function(data){
        console.log('sending private', data);
        io.in(data.to).emit('pmessage',data);
    })
  
  });
  </code></pre>
  
  <p>client side</p>
  
  <pre><code>  handleSubmit(){
       var newMSG= {
          to: this.state.selectedFriend,
          from: this.props.user.username,
          message: 'new message yay'
         }
      this.state.socket.emit('send private', newMSG);
    }
  
    componentDidMount(){
      var self = this;
  
      self.state.socket.on('pmessage', function(data){
          console.log('receiving private!', data);
        document.getElementById('myprivates').innerHTML= "&lt;p&gt;&lt;em&gt;"+data.message+"&lt;/em&gt;&lt;/p&gt;";
      })  
  
    }
  </code></pre>
  
  <p>I can't get the 'pmessage' emit event to trigger, so I'm thinking I'm not doing the io.in() part right.  I'm trying to implement private communication using the users' usernames but I can't find clear examples or documentation on this.  I followed the docs on socket io so I should be close or working but it's not.</p>