promoteIdentifier() — react Function Reference
Architecture documentation for the promoteIdentifier() function in PromoteUsedTemporaries.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 81fadb8d_22f1_6208_bbd3_8af4016beda9["promoteIdentifier()"] dea6b9e7_3c69_6e86_5d64_ba83c7d43ed6["PromoteUsedTemporaries.ts"] 81fadb8d_22f1_6208_bbd3_8af4016beda9 -->|defined in| dea6b9e7_3c69_6e86_5d64_ba83c7d43ed6 5e066f27_b301_d78c_0fde_a2fbb735acd8["visitScope()"] 5e066f27_b301_d78c_0fde_a2fbb735acd8 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 db29a3b5_069a_8469_4b85_393df6b436e5["visitPrunedScope()"] db29a3b5_069a_8469_4b85_393df6b436e5 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 8c39d4a9_3e8d_e9d4_58ed_f9e45399f829["visitParam()"] 8c39d4a9_3e8d_e9d4_58ed_f9e45399f829 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 a5e11dc5_cbd8_fedf_abbb_98de9dd31fe3["visitReactiveFunctionValue()"] a5e11dc5_cbd8_fedf_abbb_98de9dd31fe3 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 5c61a7b2_e92f_44ab_4c80_8e3e17abee33["visitPlace()"] 5c61a7b2_e92f_44ab_4c80_8e3e17abee33 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 130a4090_669d_40b7_28ec_e7c937c9c3b3["traverseScopeIdentifiers()"] 130a4090_669d_40b7_28ec_e7c937c9c3b3 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 f55f5967_4a0b_f808_1e1c_34fd02a84293["visitPlace()"] f55f5967_4a0b_f808_1e1c_34fd02a84293 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 7d0786eb_5035_8035_b9d9_8acd0538e120["promoteUsedTemporaries()"] 7d0786eb_5035_8035_b9d9_8acd0538e120 -->|calls| 81fadb8d_22f1_6208_bbd3_8af4016beda9 041ca752_10c1_3cda_1f5c_02f44a01310e["invariant()"] 81fadb8d_22f1_6208_bbd3_8af4016beda9 -->|calls| 041ca752_10c1_3cda_1f5c_02f44a01310e a7ddd29d_1b90_49b2_fa66_2f273856b02a["promoteTemporaryJsxTag()"] 81fadb8d_22f1_6208_bbd3_8af4016beda9 -->|calls| a7ddd29d_1b90_49b2_fa66_2f273856b02a 216a4c34_910d_7936_33eb_adf13df70310["promoteTemporary()"] 81fadb8d_22f1_6208_bbd3_8af4016beda9 -->|calls| 216a4c34_910d_7936_33eb_adf13df70310 style 81fadb8d_22f1_6208_bbd3_8af4016beda9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts lines 452–464
function promoteIdentifier(identifier: Identifier, state: State): void {
CompilerError.invariant(identifier.name === null, {
reason:
'promoteTemporary: Expected to be called only for temporary variables',
loc: GeneratedSource,
});
if (state.tags.has(identifier.declarationId)) {
promoteTemporaryJsxTag(identifier);
} else {
promoteTemporary(identifier);
}
state.promoted.add(identifier.declarationId);
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does promoteIdentifier() do?
promoteIdentifier() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts.
Where is promoteIdentifier() defined?
promoteIdentifier() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PromoteUsedTemporaries.ts at line 452.
What does promoteIdentifier() call?
promoteIdentifier() calls 3 function(s): invariant, promoteTemporary, promoteTemporaryJsxTag.
What calls promoteIdentifier()?
promoteIdentifier() is called by 8 function(s): promoteUsedTemporaries, traverseScopeIdentifiers, visitParam, visitPlace, visitPlace, visitPrunedScope, visitReactiveFunctionValue, visitScope.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free