Skip to main content

Type alias: SetValueAction<T>

Ƭ SetValueAction<T>: T | (currentValue: T) => T

A value passed to FormState.setFieldValue. If defined as a function it will be be called with the previous value to return an updated value.

const form = new FormState({name: 'name'}, ...);
form.setFieldValue('name', 'updated');
form.getFieldValue('name'); // 'updated'
form.setFieldValue('name', (value) => value + ' again');
form.getFieldValue('name'); // 'updated again'

Type parameters#

NameDescription
TField value type.