Fiber: Fix reconciling after null (#8202)
Before, this code was bailing out after encoutering a null child because it thought it was out of old children. Seen when reconciling [null, <span />, <Image />] with [null, <span />, <Image />] in XUISelector.
Ben Alpert committed
Nov 3, 2016 at 23:56 UTC
f4a42b872b25736bb80979804e4c8e1182fc327d
3 files changed
+4
-3
scripts/fiber/tests-failing.txt
-3
@@ -568,9 +568,6 @@ src/renderers/shared/stack/reconciler/__tests__/ReactEmptyComponent-test.js
568
src/renderers/shared/stack/reconciler/__tests__/ReactMultiChild-test.js
569
* should warn for duplicated keys with component stack info
570
571
-src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildReconcile-test.js
572
-* should insert non-empty children in middle where nulls were
573
-
571
src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildText-test.js
572
* should correctly handle all possible children for render and update
573
* should throw if rendering both HTML and children
scripts/fiber/tests-passing.txt
+1
@@ -1113,6 +1113,7 @@ src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildReconcile-test.js
1113
* should not insert empty children in the middle
1114
* should insert one new child in the middle
1115
* should insert multiple new truthy children in the middle
1116
+* should insert non-empty children in middle where nulls were
1117
1118
src/renderers/shared/stack/reconciler/__tests__/ReactMultiChildText-test.js
1119
* should render between nested components and inline children
src/renderers/shared/fiber/ReactChildFiber.js
+3
@@ -529,6 +529,9 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
529
// unfortunate because it triggers the slow path all the time. We need
530
// a better way to communicate whether this was a miss or null,
531
// boolean, undefined, etc.
532
+ if (!oldFiber) {
533
+ oldFiber = nextOldFiber;
534
+ }
535
break;
536
}
537
if (shouldTrackSideEffects) {