pub fn Counter(ctx: *zx.ComponentCtx(struct { initial: i32 })) ?zx.Component {
    const state_count = ctx.state(i32, ctx.props.initial);

    return (
        <div @allocator={ctx.allocator} data-count={state_count}>
            <h5>State (re-render): {state_count}</h5>
            <button onclick={state_count.bind(increment)}>State + {state_count}</button>
            <br /><br />
        </div>
    );
}

fn zero(_: i32) i32 {
    return 0;
}
fn increment(x: i32) i32 {
    return x + 1;
}
fn decrement(x: i32) i32 {
    return x - 1;
}

const zx = @import("zx");
const std = @import("std");
