@@ -350,7 +350,6 @@ let spawnedWorkDuringRender: null | Array<Lane | Lanes> = null;
350350// event times as simultaneous, even if the actual clock time has advanced
351351// between the first and second call.
352352let currentEventTime: number = NoTimestamp;
353- let currentEventWipLanes: Lanes = NoLanes;
354353let currentEventTransitionLane: Lanes = NoLanes;
355354
356355// Dev only flag that tracks if passive effects are currently being flushed.
@@ -402,27 +401,17 @@ export function requestUpdateLane(fiber: Fiber): Lane {
402401 return pickArbitraryLane ( workInProgressRootRenderLanes ) ;
403402 }
404403
405- // The algorithm for assigning an update to a lane should be stable for all
406- // updates at the same priority within the same event. To do this, the inputs
407- // to the algorithm must be the same. For example, we use the `renderLanes`
408- // to avoid choosing a lane that is already in the middle of rendering.
409- //
410- // However, the "included" lanes could be mutated in between updates in the
411- // same event, like if you perform an update inside `flushSync`. Or any other
412- // code path that might call `prepareFreshStack`.
413- //
414- // The trick we use is to cache the first of each of these inputs within an
415- // event. Then reset the cached values once we can be sure the event is over.
416- // Our heuristic for that is whenever we enter a concurrent work loop.
417- //
418- // We'll do the same for `currentEventTransitionLane` below.
419- if (currentEventWipLanes === NoLanes) {
420- currentEventWipLanes = workInProgressRootIncludedLanes ;
421- }
422-
423404 const isTransition = requestCurrentTransition() !== NoTransition;
424405 if (isTransition) {
406+ // The algorithm for assigning an update to a lane should be stable for all
407+ // updates at the same priority within the same event. To do this, the
408+ // inputs to the algorithm must be the same.
409+ //
410+ // The trick we use is to cache the first of each of these inputs within an
411+ // event. Then reset the cached values once we can be sure the event is
412+ // over. Our heuristic for that is whenever we enter a concurrent work loop.
425413 if ( currentEventTransitionLane === NoLane ) {
414+ // All transitions within the same event are assigned the same lane.
426415 currentEventTransitionLane = claimNextTransitionLane ( ) ;
427416 }
428417 return currentEventTransitionLane;
@@ -460,11 +449,6 @@ function requestRetryLane(fiber: Fiber) {
460449 return ( SyncLane : Lane ) ;
461450 }
462451
463- // See `requestUpdateLane` for explanation of `currentEventWipLanes`
464- if (currentEventWipLanes === NoLanes) {
465- currentEventWipLanes = workInProgressRootIncludedLanes ;
466- }
467-
468452 return claimNextRetryLane();
469453}
470454
@@ -748,7 +732,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
748732 // Since we know we're in a React event, we can clear the current
749733 // event time. The next update will compute a new event time.
750734 currentEventTime = NoTimestamp;
751- currentEventWipLanes = NoLanes;
752735 currentEventTransitionLane = NoLanes;
753736
754737 invariant(
0 commit comments