Skip to content

JSXFragmentNode

reference
1 min readUpdated

Kind: Class

Source: src/jsx/base.ts

Part of: Jsx

JSXFragmentNode represents a JSX fragment node within the JSX node model. Its toStringToBuffer() method writes the fragment’s string form to the active output buffer instead of returning a string.

Extends: JSXNode

Methods

MethodSignatureReturns
toStringToBuffertoStringToBuffer(buffer: StringBufferWithCallbacks)void

Diagram

mermaid
graph LR
  Fragment[JSXFragmentNode] --> Writer[toStringToBuffer()]
  Writer --> Buffer[Output Buffer]

Usage

ts
import { JSXFragmentNode } from "./jsx/base";

function writeFragment(fragment: JSXFragmentNode): void {
  fragment.toStringToBuffer();
}

AI Coding Instructions

  • Call toStringToBuffer() when rendering a fragment through the buffer-based output path.
  • Do not expect toStringToBuffer() to return rendered content; it returns void.
  • Keep fragment rendering consistent with other JSX node types in src/jsx/base.ts.
  • Pass JSXFragmentNode instances through code that manages the active output buffer.

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • Contextsrc/jsx/context.ts:8

Was this page helpful?

Download as PDF
JSXFragmentNode — Hono (narrator proof)