API Reference / @gtkx/react / config / defineBehavior
Variable: defineBehavior
constdefineBehavior: <T>(hooks) =>ElementBehavior<never>
Defined in: reconciler/registry.d.ts:117
Types one behavior against the GObject class it applies to, so every hook's object parameter is inferred rather than annotated by hand. Pass the class as the type argument.
ts
defineElements({
GtkFrame: { behaviors: [defineBehavior<Gtk.Frame>({ attach: (frame, child) => frame.setChild(child) })] },
});Type Parameters
T
T extends GObject.Object
Parameters
hooks
Returns
ElementBehavior<never>