ReactDOMComponent.receiveComponent
2017-03-30 17:18:43 0 举报
AI智能生成
reactDOMComponet.receiveComponent的大致思路
作者其他创作
大纲/内容
_updateDOMProperties(lastProps, nextProps)
更新dom attr
更新监听的事件
_updateDOMChildren
入口参数nextChildrenElements
updateDepth++
子主题
this._diff
参数:nextChildrenElements
读取_renderedChildren(存在renderedComponent中)
对于children中的每一个child, 建立key-element map
对比prevChildElement和nextChildElement
更新:receiveComponent
替换
得到新的children数组
对比新的children数组,将待替换、删除,添加的childComponent的属性加入diffQueue
updateDepth--
如果updateDepth = 0, patch
入口参数nextElement
updateDepth = 0
diffQueue = []
0 条评论
下一页
为你推荐
查看更多