Skip to content

@serenity-is/corelib / PropBinding

Interface: PropBinding()<T, TElement>

Defined in: ../domwise/dist/index.d.ts:121

A two-way prop binding hook created by usePropBinding. It acts as a getter when called with no arguments and a setter when called with a value; when attached as a prop hook it synchronizes that value to the bound element attribute.

Extends

Type Parameters

T

T = any

The type of the bound value.

TElement

TElement extends Element = Element

The type of the element the binding is attached to.

Call Signature

PropBinding(): T

Defined in: ../domwise/dist/index.d.ts:126

Gets the current bound value.

Returns

T

The current value.

Call Signature

PropBinding(value): T

Defined in: ../domwise/dist/index.d.ts:132

Sets the bound value and synchronizes it to the attached element (if any).

Parameters

value

T

New value to store and propagate to the DOM.

Returns

T

The value that was set.

Methods

[initPropHookSymbol]()

[initPropHookSymbol](node, propName): void

Defined in: ../domwise/dist/index.d.ts:2759

Parameters

node

TElement

propName

string

Returns

void

Inherited from

PropHook.[initPropHookSymbol]