MCPcopy
hub / github.com/facebook/react / getWrappedName

Function getWrappedName

packages/shared/getComponentNameFromType.js:36–47  ·  packages/shared/getComponentNameFromType.js::getWrappedName
(
  outerType: mixed,
  innerType: any,
  wrapperName: string,
)

Source from the content-addressed store, hash-verified

34
35class="cm">// Keep in sync with react-reconciler/getComponentNameFromFiber
36function getWrappedName(
37 outerType: mixed,
38 innerType: any,
39 wrapperName: string,
40): string {
41 const displayName = (outerType: any).displayName;
42 if (displayName) {
43 return displayName;
44 }
45 const functionName = innerType.displayName || innerType.name || class="st">'';
46 return functionName !== class="st">'' ? `${wrapperName}(${functionName})` : wrapperName;
47}
48
49class="cm">// Keep in sync with react-reconciler/getComponentNameFromFiber
50function getContextName(type: ReactContext<any>) {

Callers 1

getComponentNameFromTypeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected