title: Socket.io not removing listener from every react component
body: <p>i want to make <code>off</code> method from socket.io client to remove all match running listeners from all react components Because currently i'm listening to a same event on two different component , both are in componentDidMount,</p>
  
  <p>Board.js</p>
  
  <pre><code> socket.on('achievement', (data) =&gt; {
                  const updateAchievement= [data, ...this.state.getAchievements];
                  this.setState({
                      recentAchievements: this.state.recentAchievements.concat(data),
                      getAchievements: updateAchievement
                  });
              });
  </code></pre>
  
  <p>Dashboard.js</p>
  
  <pre><code> socket.on('achievement', (data) =&gt; {
                  const updateAchievement= [data, ...this.state.getAchievements];
                  this.setState({
                      recentAchievements: this.state.recentAchievements.concat(data),
                      getAchievements: updateAchievement
                  });
              });
  </code></pre>
  
  <p>Currently if the end-user turn off listening to the event while on DashBoard.js , the Board.js is still actively receiving data which i don't want. The board.js component is always on the view that's why i can see the data still coming.</p>
  
  <p>How i unsubscribe</p>
  
  <p>DashBoard.js</p>
  
  <pre><code>componentWillUnmount(){
              socket.off("achievement");
       }
  </code></pre>
  
  <p>Like i said above, the Board component is always in the view and i can still see data coming in.</p>
  
  <p>How can i stop this?</p>