Skip to content

Commit 299a271

Browse files
authored
Use stricter equality check (#15474)
1 parent 017d6f1 commit 299a271

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-reconciler/src/ReactChildFiber.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ function ChildReconciler(shouldTrackSideEffects) {
831831
newChildren[newIdx],
832832
expirationTime,
833833
);
834-
if (!newFiber) {
834+
if (newFiber === null) {
835835
continue;
836836
}
837837
lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
@@ -858,7 +858,7 @@ function ChildReconciler(shouldTrackSideEffects) {
858858
newChildren[newIdx],
859859
expirationTime,
860860
);
861-
if (newFiber) {
861+
if (newFiber !== null) {
862862
if (shouldTrackSideEffects) {
863863
if (newFiber.alternate !== null) {
864864
// The new fiber is a work in progress, but if there exists a
@@ -982,7 +982,7 @@ function ChildReconciler(shouldTrackSideEffects) {
982982
// unfortunate because it triggers the slow path all the time. We need
983983
// a better way to communicate whether this was a miss or null,
984984
// boolean, undefined, etc.
985-
if (!oldFiber) {
985+
if (oldFiber === null) {
986986
oldFiber = nextOldFiber;
987987
}
988988
break;

0 commit comments

Comments
 (0)