File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -3875,10 +3875,10 @@ function commitGestureOnRoot(
38753875 // We assume that the gesture we just rendered was the first one in the queue.
38763876 const finishedGesture = root . pendingGestures ;
38773877 if ( finishedGesture === null ) {
3878- throw new Error (
3879- 'Finished rendering the gesture lane but there were no pending gestures. ' +
3880- 'React should not have started a render in this case. This is a bug in React.' ,
3881- ) ;
3878+ // We must have already cancelled this gesture before we had a chance to
3879+ // render it. Let's schedule work on the next set of lanes.
3880+ ensureRootIsScheduled ( root ) ;
3881+ return ;
38823882 }
38833883 deleteScheduledGesture ( root , finishedGesture ) ;
38843884
@@ -3961,6 +3961,9 @@ function flushGestureAnimations(): void {
39613961 setCurrentUpdatePriority ( previousPriority ) ;
39623962 ReactSharedInternals . T = prevTransition ;
39633963 }
3964+
3965+ // Now that we've rendered this lane. Start working on the next lane.
3966+ ensureRootIsScheduled ( root ) ;
39643967}
39653968
39663969function makeErrorInfo ( componentStack : ?string ) {
You can’t perform that action at this time.
0 commit comments