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.Node | Interface returned by component functions. |
|---|---|
gx.Element | Creates an intrinsic element node. |
gx.Text | Creates escaped text. |
gx.Fragment | Groups children without an extra element. |
gx.Render | Renders 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.