Unmounting React.js node

前端 未结 6 505
北海茫月
北海茫月 2020-12-07 18:36

I\'m trying to unmount a React.js node with this._rootNodeID

 handleClick: function() {

        React.unmountComponentAtNode(this.         


        
6条回答
  •  生来不讨喜
    2020-12-07 19:10

    The example I use:

    unmount: function() {
      var node = this.getDOMNode();
      React.unmountComponentAtNode(node);
      $(node).remove();
    },
    
    handleClick: function() {
      this.unmount();
    }
    

提交回复
热议问题