Home / Function/ getClassNameByType() — react Function Reference

getClassNameByType() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ec4f9a6c_1d22_5fc6_c1b9_fba1f26b3cd8["getClassNameByType()"]
  d8bd6ba1_1cbe_86c2_6f2f_604c53e981b3["ReactFiberViewTransitionComponent.js"]
  ec4f9a6c_1d22_5fc6_c1b9_fba1f26b3cd8 -->|defined in| d8bd6ba1_1cbe_86c2_6f2f_604c53e981b3
  be70b440_45eb_ff76_0bc6_50898635623c["getViewTransitionClassName()"]
  be70b440_45eb_ff76_0bc6_50898635623c -->|calls| ec4f9a6c_1d22_5fc6_c1b9_fba1f26b3cd8
  style ec4f9a6c_1d22_5fc6_c1b9_fba1f26b3cd8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberViewTransitionComponent.js lines 49–77

function getClassNameByType(classByType: ?ViewTransitionClass): ?string {
  if (classByType == null || typeof classByType === 'string') {
    return classByType;
  }
  let className: ?string = null;
  const activeTypes = getPendingTransitionTypes();
  if (activeTypes !== null) {
    for (let i = 0; i < activeTypes.length; i++) {
      const match = classByType[activeTypes[i]];
      if (match != null) {
        if (match === 'none') {
          // If anything matches "none" that takes precedence over any other
          // type that also matches.
          return 'none';
        }
        if (className == null) {
          className = match;
        } else {
          className += ' ' + match;
        }
      }
    }
  }
  if (className == null) {
    // We had no other matches. Match the default for this configuration.
    return classByType.default;
  }
  return className;
}

Domain

Subdomains

Frequently Asked Questions

What does getClassNameByType() do?
getClassNameByType() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberViewTransitionComponent.js.
Where is getClassNameByType() defined?
getClassNameByType() is defined in packages/react-reconciler/src/ReactFiberViewTransitionComponent.js at line 49.
What calls getClassNameByType()?
getClassNameByType() is called by 1 function(s): getViewTransitionClassName.

Analyze Your Own Codebase

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

Try Supermodel Free