Home / Function/ listenToAllSupportedEvents() — react Function Reference

listenToAllSupportedEvents() — react Function Reference

Architecture documentation for the listenToAllSupportedEvents() function in DOMPluginEventSystem.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  1884d626_40ec_9a1b_479a_628847a0dfef["listenToAllSupportedEvents()"]
  816b54e5_c63c_f8b2_68e8_0c637e281f03["DOMPluginEventSystem.js"]
  1884d626_40ec_9a1b_479a_628847a0dfef -->|defined in| 816b54e5_c63c_f8b2_68e8_0c637e281f03
  e1b9c7d1_a1e1_1549_f27b_3d61efc611d5["listenToNativeEvent()"]
  1884d626_40ec_9a1b_479a_628847a0dfef -->|calls| e1b9c7d1_a1e1_1549_f27b_3d61efc611d5
  style 1884d626_40ec_9a1b_479a_628847a0dfef fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/events/DOMPluginEventSystem.js lines 432–458

export function listenToAllSupportedEvents(rootContainerElement: EventTarget) {
  if (!(rootContainerElement: any)[listeningMarker]) {
    (rootContainerElement: any)[listeningMarker] = true;
    allNativeEvents.forEach(domEventName => {
      // We handle selectionchange separately because it
      // doesn't bubble and needs to be on the document.
      if (domEventName !== 'selectionchange') {
        if (!nonDelegatedEvents.has(domEventName)) {
          listenToNativeEvent(domEventName, false, rootContainerElement);
        }
        listenToNativeEvent(domEventName, true, rootContainerElement);
      }
    });
    const ownerDocument =
      (rootContainerElement: any).nodeType === DOCUMENT_NODE
        ? rootContainerElement
        : (rootContainerElement: any).ownerDocument;
    if (ownerDocument !== null) {
      // The selectionchange event also needs deduplication
      // but it is attached to the document.
      if (!(ownerDocument: any)[listeningMarker]) {
        (ownerDocument: any)[listeningMarker] = true;
        listenToNativeEvent('selectionchange', false, ownerDocument);
      }
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does listenToAllSupportedEvents() do?
listenToAllSupportedEvents() is a function in the react codebase, defined in packages/react-dom-bindings/src/events/DOMPluginEventSystem.js.
Where is listenToAllSupportedEvents() defined?
listenToAllSupportedEvents() is defined in packages/react-dom-bindings/src/events/DOMPluginEventSystem.js at line 432.
What does listenToAllSupportedEvents() call?
listenToAllSupportedEvents() calls 1 function(s): listenToNativeEvent.

Analyze Your Own Codebase

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

Try Supermodel Free