Core API Overview > @adpt/core > useInstanceValue
useInstanceValue() function
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Get the value of field from the instance referenced by handled instance.
Signature:
export declare function useInstanceValue<T>(hand: Handle, initial: T, field: string): T;
Parameters
Parameter | Type | Description |
---|---|---|
hand | Handle | |
initial | T | |
field | string |
Returns:
T
Remarks
On first invocation, or if the handle is not associated with an element, or the field is not found, the value of initial
will be returned. After the element referenced by handle has been instantiated, this hook will fetch the actual value of field
, cause a rebuild, and then return that value on the next call of the hook.