Home / Function/ addTouch() — react Function Reference

addTouch() — react Function Reference

Architecture documentation for the addTouch() function in touchStore.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  52771804_c0eb_2d50_479d_4a901e3c442f["addTouch()"]
  56f57e4a_fc42_037d_ee3b_9463227d15f3["touchStore.js"]
  52771804_c0eb_2d50_479d_4a901e3c442f -->|defined in| 56f57e4a_fc42_037d_ee3b_9463227d15f3
  6e92fb29_1b7c_e506_23d4_54a296376a58["contextmenu()"]
  6e92fb29_1b7c_e506_23d4_54a296376a58 -->|calls| 52771804_c0eb_2d50_479d_4a901e3c442f
  9d0dad3b_5733_de1f_1a31_75b5db0ccd25["pointerdown()"]
  9d0dad3b_5733_de1f_1a31_75b5db0ccd25 -->|calls| 52771804_c0eb_2d50_479d_4a901e3c442f
  style 52771804_c0eb_2d50_479d_4a901e3c442f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/dom-event-testing-library/touchStore.js lines 20–35

export function addTouch(touch) {
  const identifier = touch.identifier;
  const target = touch.target;
  if (!activeTouches.has(target)) {
    activeTouches.set(target, new Map());
  }
  if (activeTouches.get(target).get(identifier)) {
    // Do not allow existing touches to be overwritten
    console.error(
      'Touch with identifier %s already exists. Did not record touch start.',
      identifier,
    );
  } else {
    activeTouches.get(target).set(identifier, touch);
  }
}

Domain

Subdomains

Frequently Asked Questions

What does addTouch() do?
addTouch() is a function in the react codebase, defined in packages/dom-event-testing-library/touchStore.js.
Where is addTouch() defined?
addTouch() is defined in packages/dom-event-testing-library/touchStore.js at line 20.
What calls addTouch()?
addTouch() is called by 2 function(s): contextmenu, pointerdown.

Analyze Your Own Codebase

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

Try Supermodel Free