Skip to content

API Reference / @gtkx/react / config / ElementBehavior

Type Alias: ElementBehavior<T> ​

ElementBehavior<T> = object

Defined in: packages/react/src/reconciler/registry.ts:34

Type Parameters ​

T ​

T extends GObject.Object = GObject.Object

Properties ​

attach? ​

optional attach?: (object, child, info) => unknown

Defined in: packages/react/src/reconciler/registry.ts:38

Places a child, claiming it by returning anything other than undefined.

Parameters ​

object ​

T

child ​

GObject.Object

info ​

PlaceInfo

Returns ​

unknown


constructOnly? ​

optional constructOnly?: string[]

Defined in: packages/react/src/reconciler/registry.ts:52

Props the behavior can only apply while the element is being built, because the library exposes no counterpart to whatever applied them. Changing one after it has been applied throws instead of silently applying the new value on top of the old.


create? ​

optional create?: (props) => GObject.Object

Defined in: packages/react/src/reconciler/registry.ts:36

Builds the GObject from its construct props, for types whose constructor does more than set properties.

Parameters ​

props ​

Props

Returns ​

GObject.Object


detach? ​

optional detach?: (object, child, info) => void

Defined in: packages/react/src/reconciler/registry.ts:42

Removes a child this behavior attached.

Parameters ​

object ​

T

child ​

GObject.Object

info ​

DetachInfo

Returns ​

void


reorder? ​

optional reorder?: (object, child, info) => unknown

Defined in: packages/react/src/reconciler/registry.ts:40

Moves an already-attached child; without it, the whole slot is detached and re-attached in order.

Parameters ​

object ​

T

child ​

GObject.Object

info ​

PlaceInfo

Returns ​

unknown


resolve? ​

optional resolve?: (object, child) => GObject.Object | null

Defined in: packages/react/src/reconciler/registry.ts:44

Returns the object the container adopts for a child, overriding whatever attach returned.

Parameters ​

object ​

T

child ​

GObject.Object

Returns ​

GObject.Object | null


update? ​

optional update?: (object, prev, next) => Iterable<string> | undefined

Defined in: packages/react/src/reconciler/registry.ts:46

Applies changed props and returns the names it consumed, which are then not set as GObject properties.

Parameters ​

object ​

T

prev ​

Props

next ​

Props

Returns ​

Iterable<string> | undefined