Home / Function/ setPointerEvent() — react Function Reference

setPointerEvent() — react Function Reference

Architecture documentation for the setPointerEvent() function in domEnvironment.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  fc292dc3_3a11_3f76_520e_fd7050406acc["setPointerEvent()"]
  c03693b0_2482_9a7d_a058_7ba891e5839d["domEnvironment.js"]
  fc292dc3_3a11_3f76_520e_fd7050406acc -->|defined in| c03693b0_2482_9a7d_a058_7ba891e5839d
  657afeb3_4a7c_6f61_d659_e1d95b512447["describeWithPointerEvent()"]
  657afeb3_4a7c_6f61_d659_e1d95b512447 -->|calls| fc292dc3_3a11_3f76_520e_fd7050406acc
  style fc292dc3_3a11_3f76_520e_fd7050406acc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/dom-event-testing-library/domEnvironment.js lines 22–37

export function setPointerEvent(bool) {
  const pointerCaptureFn = name => id => {
    if (typeof id !== 'number') {
      if (__DEV__) {
        console.error('A pointerId must be passed to "%s"', name);
      }
    }
  };
  global.PointerEvent = bool ? emptyFunction : undefined;
  global.HTMLElement.prototype.setPointerCapture = bool
    ? pointerCaptureFn('setPointerCapture')
    : undefined;
  global.HTMLElement.prototype.releasePointerCapture = bool
    ? pointerCaptureFn('releasePointerCapture')
    : undefined;
}

Domain

Subdomains

Frequently Asked Questions

What does setPointerEvent() do?
setPointerEvent() is a function in the react codebase, defined in packages/dom-event-testing-library/domEnvironment.js.
Where is setPointerEvent() defined?
setPointerEvent() is defined in packages/dom-event-testing-library/domEnvironment.js at line 22.
What calls setPointerEvent()?
setPointerEvent() is called by 1 function(s): describeWithPointerEvent.

Analyze Your Own Codebase

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

Try Supermodel Free