Skip to content

Commit eac3c95

Browse files
authored
Defer useDeferredValue updates in Gestures (facebook#35511)
If an initial value is specified, then it's always used regardless as part of the gesture render. If a gesture render causes an update, then previously that was not treated as deferred and could therefore be blocking the render. However, a gesture is supposed to flush synchronously ideally. Therefore we should consider these as urgent. The effect is that useDeferredValue renders the previous state.
1 parent 35a81ce commit eac3c95

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/react-reconciler/src/ReactFiberLane.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ export function includesOnlyRetries(lanes: Lanes): boolean {
621621
export function includesOnlyNonUrgentLanes(lanes: Lanes): boolean {
622622
// TODO: Should hydration lanes be included here? This function is only
623623
// used in `updateDeferredValueImpl`.
624-
const UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;
624+
const UrgentLanes =
625+
SyncLane | InputContinuousLane | DefaultLane | GestureLane;
625626
return (lanes & UrgentLanes) === NoLanes;
626627
}
627628
export function includesOnlyTransitions(lanes: Lanes): boolean {

0 commit comments

Comments
 (0)