Preparing search index...

    Function makeFormSetter

    • Returns a setter that accepts either a direct value or a functional updater (prev) => next. The current field value is read lazily via form.getValues so functional updaters always see the latest state.

      The optional options argument is forwarded to every form.setValue call the setter makes — pass { shouldValidate: true } when subsequent validation runs should reflect the new value, or { shouldDirty: false } when the write should not mark the form dirty.

      Type Parameters

      • TForm extends FieldValues
      • K extends string

      Parameters

      • form: UseFormReturn<TForm, unknown, FieldValues>
      • name: K
      • Optionaloptions: Partial<
            {
                shouldValidate: boolean;
                shouldDirty: boolean;
                shouldTouch: boolean;
                delayError: boolean;
            },
        >

      Returns Dispatch<SetStateAction<PathValue<TForm, K>>>