GeezerVison is showing github.com — Add Placement bit without removing others (#20398) · react/react@1377e46
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/react-reconciler/src
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactChildFiber.new.js +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -342,15 +342,15 @@ function ChildReconciler(shouldTrackSideEffects) { |
342 | 342 | const oldIndex = current.index; |
343 | 343 | if (oldIndex < lastPlacedIndex) { |
344 | 344 | // This is a move. |
345 | | - newFiber.flags = Placement; |
| 345 | + newFiber.flags |= Placement; |
346 | 346 | return lastPlacedIndex; |
347 | 347 | } else { |
348 | 348 | // This item can stay in place. |
349 | 349 | return oldIndex; |
350 | 350 | } |
351 | 351 | } else { |
352 | 352 | // This is an insertion. |
353 | | - newFiber.flags = Placement; |
| 353 | + newFiber.flags |= Placement; |
354 | 354 | return lastPlacedIndex; |
355 | 355 | } |
356 | 356 | } |
@@ -359,7 +359,7 @@ function ChildReconciler(shouldTrackSideEffects) { |
359 | 359 | // This is simpler for the single child case. We only need to do a |
360 | 360 | // placement for inserting new children. |
361 | 361 | if (shouldTrackSideEffects && newFiber.alternate === null) { |
362 | | - newFiber.flags = Placement; |
| 362 | + newFiber.flags |= Placement; |
363 | 363 | } |
364 | 364 | return newFiber; |
365 | 365 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactChildFiber.old.js +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -342,15 +342,15 @@ function ChildReconciler(shouldTrackSideEffects) { |
342 | 342 | const oldIndex = current.index; |
343 | 343 | if (oldIndex < lastPlacedIndex) { |
344 | 344 | // This is a move. |
345 | | - newFiber.flags = Placement; |
| 345 | + newFiber.flags |= Placement; |
346 | 346 | return lastPlacedIndex; |
347 | 347 | } else { |
348 | 348 | // This item can stay in place. |
349 | 349 | return oldIndex; |
350 | 350 | } |
351 | 351 | } else { |
352 | 352 | // This is an insertion. |
353 | | - newFiber.flags = Placement; |
| 353 | + newFiber.flags |= Placement; |
354 | 354 | return lastPlacedIndex; |
355 | 355 | } |
356 | 356 | } |
@@ -359,7 +359,7 @@ function ChildReconciler(shouldTrackSideEffects) { |
359 | 359 | // This is simpler for the single child case. We only need to do a |
360 | 360 | // placement for inserting new children. |
361 | 361 | if (shouldTrackSideEffects && newFiber.alternate === null) { |
362 | | - newFiber.flags = Placement; |
| 362 | + newFiber.flags |= Placement; |
363 | 363 | } |
364 | 364 | return newFiber; |
365 | 365 | } |
|