GX Framework

Rendering

GX rendering is deterministic so pages, snapshots, and tests can compare stable output. The renderer consumes the node tree and turns it into HTML without losing the structure that came from the authored component code.

Core rendering APIs

gx.NodeInterface returned by component functions.
gx.ElementCreates an intrinsic element node.
gx.TextCreates escaped text.
gx.FragmentGroups children without an extra element.
gx.RenderRenders stable HTML.

Example

html, err := gx.Render(gx.Element("p",
  gx.Props{"class": "message"},
  gx.Text("Hello <Bus>"),
))

See also Nodes and render tree and Testing.