Home / Function/ findInvalidAncestorForTag() — react Function Reference

findInvalidAncestorForTag() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3f347104_9d92_b69f_afb5_0f4b1003a5b4["findInvalidAncestorForTag()"]
  99b6f05f_c8d3_afa4_842b_34ebebb1f8a7["validateDOMNesting.js"]
  3f347104_9d92_b69f_afb5_0f4b1003a5b4 -->|defined in| 99b6f05f_c8d3_afa4_842b_34ebebb1f8a7
  96e5c4d9_bcbf_86ea_69bb_cc3d02fbd794["validateDOMNesting()"]
  96e5c4d9_bcbf_86ea_69bb_cc3d02fbd794 -->|calls| 3f347104_9d92_b69f_afb5_0f4b1003a5b4
  style 3f347104_9d92_b69f_afb5_0f4b1003a5b4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/client/validateDOMNesting.js lines 465–530

function findInvalidAncestorForTag(
  tag: string,
  ancestorInfo: AncestorInfoDev,
): ?Info {
  switch (tag) {
    case 'address':
    case 'article':
    case 'aside':
    case 'blockquote':
    case 'center':
    case 'details':
    case 'dialog':
    case 'dir':
    case 'div':
    case 'dl':
    case 'fieldset':
    case 'figcaption':
    case 'figure':
    case 'footer':
    case 'header':
    case 'hgroup':
    case 'main':
    case 'menu':
    case 'nav':
    case 'ol':
    case 'p':
    case 'section':
    case 'summary':
    case 'ul':
    case 'pre':
    case 'listing':
    case 'table':
    case 'hr':
    case 'xmp':
    case 'h1':
    case 'h2':
    case 'h3':
    case 'h4':
    case 'h5':
    case 'h6':
      return ancestorInfo.pTagInButtonScope;

    case 'form':
      return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;

    case 'li':
      return ancestorInfo.listItemTagAutoclosing;

    case 'dd':
    case 'dt':
      return ancestorInfo.dlItemTagAutoclosing;

    case 'button':
      return ancestorInfo.buttonTagInScope;

    case 'a':
      // Spec says something about storing a list of markers, but it sounds
      // equivalent to this check.
      return ancestorInfo.aTagInScope;

    case 'nobr':
      return ancestorInfo.nobrTagInScope;
  }

  return null;
}

Domain

Subdomains

Frequently Asked Questions

What does findInvalidAncestorForTag() do?
findInvalidAncestorForTag() is a function in the react codebase, defined in packages/react-dom-bindings/src/client/validateDOMNesting.js.
Where is findInvalidAncestorForTag() defined?
findInvalidAncestorForTag() is defined in packages/react-dom-bindings/src/client/validateDOMNesting.js at line 465.
What calls findInvalidAncestorForTag()?
findInvalidAncestorForTag() is called by 1 function(s): validateDOMNesting.

Analyze Your Own Codebase

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

Try Supermodel Free