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

Function getWrappedName

packages/shared/getComponentNameFromType.js:36–47  ·  view source on GitHub ↗
(
  outerType: mixed,
  innerType: any,
  wrapperName: string,
)

Source from the content-addressed store, hash-verified

34
35// 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 || '';
46 return functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName;
47}
48
49// 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