閱讀react源碼時產(chǎn)生的疑問?
今天讀react源碼有一個地方不太懂(第一次提問,多多指教)疑問在下方調(diào)用方法unmountComponent()處
// 卸載組件unmountComponent: function() {// 設(shè)置狀態(tài)為 UNMOUNTING this._compositeLifeCycleState = CompositeLifeCycle.UNMOUNTING;// 如果存在 componentWillUnmount,則觸發(fā)if (this.componentWillUnmount) { this.componentWillUnmount(); }// 更新狀態(tài)為 nullthis._compositeLifeCycleState =<愛尬聊_創(chuàng)建詞條> null;//**下面調(diào)用unmountComponent()不會死循環(huán)嗎** this._renderedComponent.unmountComponent();this._renderedComponent = null; ReactComponent.Mixin.unmountComponent.call(this); }