Home / Function/ write() — react Function Reference

write() — react Function Reference

Architecture documentation for the write() function in PrintReactiveFunction.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ccaebcb0_5128_cdb1_7336_203ff87e3e3c["write()"]
  b243acad_c177_f3f5_fda5_38b82f61b907["Writer"]
  ccaebcb0_5128_cdb1_7336_203ff87e3e3c -->|defined in| b243acad_c177_f3f5_fda5_38b82f61b907
  5b0b4134_f31c_d57b_a687_fa6358a8ebe1["writeReactiveInstruction()"]
  5b0b4134_f31c_d57b_a687_fa6358a8ebe1 -->|calls| ccaebcb0_5128_cdb1_7336_203ff87e3e3c
  71a9f37b_77ef_a53d_21a5_a209ffc89311["writeReactiveValue()"]
  71a9f37b_77ef_a53d_21a5_a209ffc89311 -->|calls| ccaebcb0_5128_cdb1_7336_203ff87e3e3c
  c8b741bc_d083_e427_bf52_4efdedb0cfca["writeTerminal()"]
  c8b741bc_d083_e427_bf52_4efdedb0cfca -->|calls| ccaebcb0_5128_cdb1_7336_203ff87e3e3c
  08b5ffb9_71a2_1b17_07aa_5fc920192756["append()"]
  08b5ffb9_71a2_1b17_07aa_5fc920192756 -->|calls| ccaebcb0_5128_cdb1_7336_203ff87e3e3c
  d0290dff_c442_0216_dbb6_27657f40b130["writeLine()"]
  d0290dff_c442_0216_dbb6_27657f40b130 -->|calls| ccaebcb0_5128_cdb1_7336_203ff87e3e3c
  style ccaebcb0_5128_cdb1_7336_203ff87e3e3c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts lines 439–445

  write(s: string): void {
    if (this.#line.length === 0 && this.#depth > 0) {
      // indent before writing
      this.#line = '  '.repeat(this.#depth);
    }
    this.#line += s;
  }

Domain

Subdomains

Frequently Asked Questions

What does write() do?
write() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts.
Where is write() defined?
write() is defined in compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/PrintReactiveFunction.ts at line 439.
What calls write()?
write() is called by 5 function(s): append, writeLine, writeReactiveInstruction, writeReactiveValue, writeTerminal.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free