Home / Function/ scheduleGesture() — react Function Reference

scheduleGesture() — react Function Reference

Architecture documentation for the scheduleGesture() function in ReactFiberGestureScheduler.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  9d2407df_b50c_30c1_b998_c9b7a7af1998["scheduleGesture()"]
  8193bb5a_9f72_452e_5391_5f40038fa638["ReactFiberGestureScheduler.js"]
  9d2407df_b50c_30c1_b998_c9b7a7af1998 -->|defined in| 8193bb5a_9f72_452e_5391_5f40038fa638
  3aa9c8cd_1d3e_a63b_dc04_9103ee37fc22["ensureRootIsScheduled()"]
  9d2407df_b50c_30c1_b998_c9b7a7af1998 -->|calls| 3aa9c8cd_1d3e_a63b_dc04_9103ee37fc22
  style 9d2407df_b50c_30c1_b998_c9b7a7af1998 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberGestureScheduler.js lines 45–81

export function scheduleGesture(
  root: FiberRoot,
  provider: GestureTimeline,
): ScheduledGesture {
  let prev = root.pendingGestures;
  while (prev !== null) {
    if (prev.provider === provider) {
      // Existing instance found.
      return prev;
    }
    const next = prev.next;
    if (next === null) {
      break;
    }
    prev = next;
  }
  const gesture: ScheduledGesture = {
    provider: provider,
    count: 0,
    rangeStart: 0, // Uninitialized
    rangeEnd: 100, // Uninitialized
    types: null,
    running: null,
    commit: null,
    committing: false,
    revertLane: NoLane, // Starts uninitialized.
    prev: prev,
    next: null,
  };
  if (prev === null) {
    root.pendingGestures = gesture;
  } else {
    prev.next = gesture;
  }
  ensureRootIsScheduled(root);
  return gesture;
}

Domain

Subdomains

Frequently Asked Questions

What does scheduleGesture() do?
scheduleGesture() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberGestureScheduler.js.
Where is scheduleGesture() defined?
scheduleGesture() is defined in packages/react-reconciler/src/ReactFiberGestureScheduler.js at line 45.
What does scheduleGesture() call?
scheduleGesture() calls 1 function(s): ensureRootIsScheduled.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free