writeReactiveValue() — react Function Reference
Architecture documentation for the writeReactiveValue() function in PrintReactiveFunction.ts from the react codebase.
Entity Profile
Dependency Diagram
graph TD 71a9f37b_77ef_a53d_21a5_a209ffc89311["writeReactiveValue()"] d77f9ffb_2d12_7d1f_126f_8c05214f0059["PrintReactiveFunction.ts"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|defined in| d77f9ffb_2d12_7d1f_126f_8c05214f0059 5b0b4134_f31c_d57b_a687_fa6358a8ebe1["writeReactiveInstruction()"] 5b0b4134_f31c_d57b_a687_fa6358a8ebe1 -->|calls| 71a9f37b_77ef_a53d_21a5_a209ffc89311 4011555a_65ff_eab8_3b9c_d51c4a9422ba["printReactiveValue()"] 4011555a_65ff_eab8_3b9c_d51c4a9422ba -->|calls| 71a9f37b_77ef_a53d_21a5_a209ffc89311 c8b741bc_d083_e427_bf52_4efdedb0cfca["writeTerminal()"] c8b741bc_d083_e427_bf52_4efdedb0cfca -->|calls| 71a9f37b_77ef_a53d_21a5_a209ffc89311 d0290dff_c442_0216_dbb6_27657f40b130["writeLine()"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| d0290dff_c442_0216_dbb6_27657f40b130 49a02012_cdfd_58a3_d7f3_fb778e20ab1b["indented()"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| 49a02012_cdfd_58a3_d7f3_fb778e20ab1b 134ef693_e561_ad46_e66b_04323b6d08cd["newline()"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| 134ef693_e561_ad46_e66b_04323b6d08cd ccaebcb0_5128_cdb1_7336_203ff87e3e3c["write()"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| ccaebcb0_5128_cdb1_7336_203ff87e3e3c 5b0b4134_f31c_d57b_a687_fa6358a8ebe1["writeReactiveInstruction()"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| 5b0b4134_f31c_d57b_a687_fa6358a8ebe1 08b5ffb9_71a2_1b17_07aa_5fc920192756["append()"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| 08b5ffb9_71a2_1b17_07aa_5fc920192756 f3619b34_2818_79d3_d2a6_72b9bcfc9d1e["printInstructionValue()"] 71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| f3619b34_2818_79d3_d2a6_72b9bcfc9d1e style 71a9f37b_77ef_a53d_21a5_a209ffc89311 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts lines 189–257
function writeReactiveValue(writer: Writer, value: ReactiveValue): void {
switch (value.kind) {
case 'ConditionalExpression': {
writer.writeLine(`Ternary `);
writer.indented(() => {
writeReactiveValue(writer, value.test);
writer.writeLine(`? `);
writer.indented(() => {
writeReactiveValue(writer, value.consequent);
});
writer.writeLine(`: `);
writer.indented(() => {
writeReactiveValue(writer, value.alternate);
});
});
writer.newline();
break;
}
case 'LogicalExpression': {
writer.writeLine(`Logical`);
writer.indented(() => {
writeReactiveValue(writer, value.left);
writer.write(`${value.operator} `);
writeReactiveValue(writer, value.right);
});
writer.newline();
break;
}
case 'SequenceExpression': {
writer.writeLine(`Sequence`);
writer.indented(() => {
writer.indented(() => {
value.instructions.forEach(instr =>
writeReactiveInstruction(writer, {
kind: 'instruction',
instruction: instr,
}),
);
writer.write(`[${value.id}] `);
writeReactiveValue(writer, value.value);
});
});
writer.newline();
break;
}
case 'OptionalExpression': {
writer.append(`OptionalExpression optional=${value.optional}`);
writer.newline();
writer.indented(() => {
writeReactiveValue(writer, value.value);
});
writer.newline();
break;
}
default: {
const printed = printInstructionValue(value);
const lines = printed.split('\n');
if (lines.length === 1) {
writer.writeLine(printed);
} else {
writer.indented(() => {
for (const line of lines) {
writer.writeLine(line);
}
});
}
}
}
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does writeReactiveValue() do?
writeReactiveValue() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts.
Where is writeReactiveValue() defined?
writeReactiveValue() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts at line 189.
What does writeReactiveValue() call?
writeReactiveValue() calls 7 function(s): append, indented, newline, printInstructionValue, write, writeLine, writeReactiveInstruction.
What calls writeReactiveValue()?
writeReactiveValue() is called by 3 function(s): printReactiveValue, writeReactiveInstruction, writeTerminal.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free