TSXLight / docsProject documentation

Reference

Component Model

Look up syntax, contracts, layouts, algorithms, and exact behavior.

A TSXLight component is a server-resident object that can render a JSX-like subtree, hold mutable state, expose lifecycle hooks, and register callbacks. The rendered client output is a projection of that object, not the owner of the object.

type Component = {
  props: Record<string, unknown>;
  state?: Record<string, unknown>;
  render(): TsxNode;
  saveState?(): unknown;
  loadState?(state: unknown): void;
  afterRender?(): void;
};
Component shape. The renderer needs render, optional state persistence hooks, and optional post-render behavior.
viewt=render(componentt)view_t = render(component_t)
Component projection. At any time, the visible shell is a projection of server component state.

The custom JSX factory creates plain element records rather than React elements. Intrinsic elements become tag records; component constructors become component records; children are stored explicitly so the server renderer can walk the whole tree.