Home / Function/ isCustomElement() — react Function Reference

isCustomElement() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2085de17_2522_af25_8b8d_76ff7166552c["isCustomElement()"]
  a7faeba1_82ce_c9a3_9363_b5e70d18a977["isCustomElement.js"]
  2085de17_2522_af25_8b8d_76ff7166552c -->|defined in| a7faeba1_82ce_c9a3_9363_b5e70d18a977
  96cf114b_9b89_b174_432c_1584a973fcdd["setInitialProperties()"]
  96cf114b_9b89_b174_432c_1584a973fcdd -->|calls| 2085de17_2522_af25_8b8d_76ff7166552c
  336b5c16_66c9_7089_05c5_2ec95eb7ed11["updateProperties()"]
  336b5c16_66c9_7089_05c5_2ec95eb7ed11 -->|calls| 2085de17_2522_af25_8b8d_76ff7166552c
  3246fe42_26b8_0630_2d76_6dda95625fe3["diffHydratedProperties()"]
  3246fe42_26b8_0630_2d76_6dda95625fe3 -->|calls| 2085de17_2522_af25_8b8d_76ff7166552c
  95ba6694_b646_2a5b_f22a_b99163c63d18["validateProperties()"]
  95ba6694_b646_2a5b_f22a_b99163c63d18 -->|calls| 2085de17_2522_af25_8b8d_76ff7166552c
  style 2085de17_2522_af25_8b8d_76ff7166552c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/shared/isCustomElement.js lines 10–31

function isCustomElement(tagName: string, props: Object): boolean {
  if (tagName.indexOf('-') === -1) {
    return false;
  }
  switch (tagName) {
    // These are reserved SVG and MathML elements.
    // We don't mind this list too much because we expect it to never grow.
    // The alternative is to track the namespace in a few places which is convoluted.
    // https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-core-concepts
    case 'annotation-xml':
    case 'color-profile':
    case 'font-face':
    case 'font-face-src':
    case 'font-face-uri':
    case 'font-face-format':
    case 'font-face-name':
    case 'missing-glyph':
      return false;
    default:
      return true;
  }
}

Domain

Subdomains

Frequently Asked Questions

What does isCustomElement() do?
isCustomElement() is a function in the react codebase, defined in packages/react-dom-bindings/src/shared/isCustomElement.js.
Where is isCustomElement() defined?
isCustomElement() is defined in packages/react-dom-bindings/src/shared/isCustomElement.js at line 10.
What calls isCustomElement()?
isCustomElement() is called by 4 function(s): diffHydratedProperties, setInitialProperties, updateProperties, validateProperties.

Analyze Your Own Codebase

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

Try Supermodel Free