ziex/site/app/pages/examples/while.zx
2026-03-18 15:19:04 +06:00

13 lines
266 B
Zig

pub fn Counter(allocator: zx.Allocator) zx.Component {
var i: usize = 0;
return (
<ul @allocator={allocator}>
{while (i < 3) : (i += 1) (
<li>Item {i}</li>
)}
</ul>
);
}
const zx = @import("zx");