Lynx

genui / openui / useSetFieldValue

useSetFieldValue()

function useSetFieldValue(): (formName: undefined | string, componentType: undefined | string, name: string, value: unknown, shouldTriggerSaveCallback?: boolean) => void

Get the setFieldValue function for updating form field values.

Returns

Function

Parameters

ParameterType
formNameundefined | string
componentTypeundefined | string
namestring
valueunknown
shouldTriggerSaveCallback?boolean

Returns

void

Example

const setFieldValue = useSetFieldValue();
<input onChange={(e) => setFieldValue("contactForm", "Input", "name", e.target.value, false)} />

Defined in

@lynx-js/genui/openui/src/core/context.tsx:154

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.