@@ -62,13 +62,7 @@ export function diffChildren(
62
62
63
63
for ( i = 0 ; i < newChildrenLength ; i ++ ) {
64
64
childVNode = newParentVNode . _children [ i ] ;
65
- if (
66
- childVNode == null ||
67
- typeof childVNode == 'boolean' ||
68
- typeof childVNode == 'function'
69
- ) {
70
- continue ;
71
- }
65
+ if ( childVNode == null ) continue ;
72
66
73
67
// At this point, constructNewChildrenArray has assigned _index to be the
74
68
// matchingIndex for this VNode's oldVNode (or -1 if there is no oldVNode).
@@ -185,6 +179,7 @@ function constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {
185
179
typeof childVNode == 'function'
186
180
) {
187
181
childVNode = newParentVNode . _children [ i ] = null ;
182
+ continue ;
188
183
}
189
184
// If this newVNode is being reused (e.g. <div>{reuse}{reuse}</div>) in the same diff,
190
185
// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have
@@ -227,11 +222,6 @@ function constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {
227
222
childVNode = newParentVNode . _children [ i ] = childVNode ;
228
223
}
229
224
230
- // Handle unmounting null placeholders, i.e. VNode => null in unkeyed children
231
- if ( childVNode == null ) {
232
- continue ;
233
- }
234
-
235
225
const skewedIndex = i + skew ;
236
226
childVNode . _parent = newParentVNode ;
237
227
childVNode . _depth = newParentVNode . _depth + 1 ;
@@ -299,9 +289,8 @@ function constructNewChildrenArray(newParentVNode, renderResult, oldChildren) {
299
289
300
290
// Move this VNode's DOM if the original index (matchingIndex) doesn't
301
291
// match the new skew index (i + new skew)
302
- if ( matchingIndex !== i + skew ) {
303
- childVNode . _flags |= INSERT_VNODE ;
304
- }
292
+ // In the former two branches we know that it matches after skewing
293
+ childVNode . _flags |= INSERT_VNODE ;
305
294
}
306
295
}
307
296
}
0 commit comments