Unmounting React.js node

前端 未结 6 507
北海茫月
北海茫月 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:06

    As mentioned in the GitHub issue you filed, if you want access to a component's DOM node, you can use this.getDOMNode(). However a component can not unmount itself. See Michael's answer for the correct way to do it.

提交回复
热议问题