react change children array 性能优化点

145 阅读1分钟

因为lastPlacedIndex对Placement的判断,最后一个节点更新到第一个节点的位置这种操作,会导致在commit dom过程中,1~n-1的子元素都会重新插入,会带来性能问题,需要避免。