Skip to main content
zerotal

Documentation


Documentation / @zerotal/flow / index / For

Function: For()

For<T>(props): HtmlNode

Defined in: flow/src/components.ts:834

Reactive list. The AOT compiler turns <For each={this.items} keyBy="id">{(item) => …}</For> into an Alpine <template x-for>, so appendOptimistic/removeOptimistic (and any client change to the array) re-render it instantly while server patches stay authoritative. This runtime body is a static fallback, used only when a page's render couldn't be ahead-of-time compiled.

Type Parameters

T

T

Parameters

props

ForProps<T>

Returns

HtmlNode

Example

<For each={this.items} keyBy="id">
  {(item) => <li>{item.name}</li>}
</For>