duplicateType() — react Function Reference
Architecture documentation for the duplicateType() function in Types.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 7d28ada8_0152_f584_b23e_b2bb48916442["duplicateType()"] f1874e3c_f8f2_5f68_d3a9_0c56c0dad5ec["Types.ts"] 7d28ada8_0152_f584_b23e_b2bb48916442 -->|defined in| f1874e3c_f8f2_5f68_d3a9_0c56c0dad5ec c50e6c61_a100_0e6f_983b_951164ba4856["makeType()"] 7d28ada8_0152_f584_b23e_b2bb48916442 -->|calls| c50e6c61_a100_0e6f_983b_951164ba4856 style 7d28ada8_0152_f584_b23e_b2bb48916442 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/HIR/Types.ts lines 106–146
export function duplicateType(type: Type): Type {
switch (type.kind) {
case 'Function': {
return {
kind: 'Function',
return: duplicateType(type.return),
shapeId: type.shapeId,
isConstructor: type.isConstructor,
};
}
case 'Object': {
return {kind: 'Object', shapeId: type.shapeId};
}
case 'ObjectMethod': {
return {kind: 'ObjectMethod'};
}
case 'Phi': {
return {
kind: 'Phi',
operands: type.operands.map(operand => duplicateType(operand)),
};
}
case 'Poly': {
return {kind: 'Poly'};
}
case 'Primitive': {
return {kind: 'Primitive'};
}
case 'Property': {
return {
kind: 'Property',
objectType: duplicateType(type.objectType),
objectName: type.objectName,
propertyName: type.propertyName,
};
}
case 'Type': {
return makeType();
}
}
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does duplicateType() do?
duplicateType() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/Types.ts.
Where is duplicateType() defined?
duplicateType() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/Types.ts at line 106.
What does duplicateType() call?
duplicateType() calls 1 function(s): makeType.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free