E0338: A hook declared by the constructor
Earlier releases let a page's constructor declare its hooks on the embedded ui.Live: p.OnMount((*Page).mount), p.Loads("rows", …), p.OnChange(…). A hook is now declared with an attribute on its method, where it is written, and ui.Live has no such methods. The compiler reports the call with the attribute to write.
Wrong
vuka
func NewOrders(db *DB) *Orders {
o := &Orders{db: db}
o.OnMount((*Orders).mount)
o.Loads("rows", (*Orders).loadRows)
return o
}Right
vuka
func NewOrders(db *DB) *Orders { return &Orders{db: db} }
@ui.Mount
func (o *Orders) mount(ctx context.Context) error { … }
@ui.Loads("rows")
func (o *Orders) loadRows(ctx context.Context) error { … }