eachPatternItem() — react Function Reference
Architecture documentation for the eachPatternItem() function in visitors.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 13924a9d_e73a_6d54_de57_dd59bb471df1["eachPatternItem()"] 2f3caf55_cc64_415c_55dd_9771ba7dc210["visitors.ts"] 13924a9d_e73a_6d54_de57_dd59bb471df1 -->|defined in| 2f3caf55_cc64_415c_55dd_9771ba7dc210 a00426de_5aa3_d680_a1fe_29201ff58984["computeSignatureForInstruction()"] a00426de_5aa3_d680_a1fe_29201ff58984 -->|calls| 13924a9d_e73a_6d54_de57_dd59bb471df1 d7fde76c_4fd9_feb3_299b_798689f05bc6["assertExhaustive()"] 13924a9d_e73a_6d54_de57_dd59bb471df1 -->|calls| d7fde76c_4fd9_feb3_299b_798689f05bc6 style 13924a9d_e73a_6d54_de57_dd59bb471df1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts lines 375–418
export function* eachPatternItem(
pattern: Pattern,
): Iterable<Place | SpreadPattern> {
switch (pattern.kind) {
case 'ArrayPattern': {
for (const item of pattern.items) {
if (item.kind === 'Identifier') {
yield item;
} else if (item.kind === 'Spread') {
yield item;
} else if (item.kind === 'Hole') {
continue;
} else {
assertExhaustive(
item,
`Unexpected item kind \`${(item as any).kind}\``,
);
}
}
break;
}
case 'ObjectPattern': {
for (const property of pattern.properties) {
if (property.kind === 'ObjectProperty') {
yield property.place;
} else if (property.kind === 'Spread') {
yield property;
} else {
assertExhaustive(
property,
`Unexpected item kind \`${(property as any).kind}\``,
);
}
}
break;
}
default: {
assertExhaustive(
pattern,
`Unexpected pattern kind \`${(pattern as any).kind}\``,
);
}
}
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does eachPatternItem() do?
eachPatternItem() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts.
Where is eachPatternItem() defined?
eachPatternItem() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/visitors.ts at line 375.
What does eachPatternItem() call?
eachPatternItem() calls 1 function(s): assertExhaustive.
What calls eachPatternItem()?
eachPatternItem() is called by 1 function(s): computeSignatureForInstruction.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free