• 컴포넌트가 제거되었을 때 Listener도 제거하기

    componentWillUnmount(){
        this.state.chatRoomsRef.off();
      }
    
  • 컴포넌트가 제거되기 전에 불러옴 - Listener를 off함