Repository: react-hook-form/react-hook-form
File: src/logic/createFormControl.ts (TypeScript)

Code before:
        });
      }
    } else {
      field && !field._f && !isNullOrUndefined(value)
        ? setValues(name, value, options)
        : setFieldValue(name, value, options);
    }

    isWatched(name, _names) && _subjects.state.next({});
    _subjects.watch.next({
      name,
    });
  };

  const handleChange: ChangeHandler = async (event) => {
    const target = event.target;
    let name = target.name;
    const field: Field = get(_fields, name);

    if (field) {
      let error;
      let isValid;
      const fieldValue = target.type ? getFieldValue(field._f) : target.value;
      const isBlurEvent = event.type === EVENTS.BLUR;
      const shouldSkipValidation =
        (!hasValidation(field._f) &&
          !_options.resolver &&
          !get(_formState.errors, name) &&
          !field._f.deps) ||
        skipValidation(
          isBlurEvent,
          get(_formState.touchedFields, name),
          _formState.isSubmitted,
          validationModeAfterSubmit,
          validationModeBeforeSubmit,
        );
      const watched = isWatched(name, _names, isBlurEvent);

      if (isBlurEvent) {
        field._f.onBlur && field._f.onBlur(event);
      } else if (field._f.onChange) {
        field._f.onChange(event);
      }

      set(_formValues, name, fieldValue);

      const fieldState = updateTouchAndDirty(
        name,
        fieldValue,
        isBlurEvent,
        false,

Review comment (suggestion):
Thanks for starting work on this so quickly!

Is this enough of a change to fix the issue we were chatting about? My concern is specifically with the Mantine RadioGroup use case where the onChange handler's type is `(value: string) => void` instead of `(e: Event) => Promise<void | boolean>`. If the "event" in this function is just a string, we will still get an error:

```typescript
const handleChange: ChangeHandler = async (event) => {
  const target = event.target; // undefined
  let name = target.name; // "Cannot read properties of undefined (reading 'name')"
  const field: Field = get(_fields, name); // won't get here, but even if it did, undefined

  if (field) { // undefined, so false and then the code changes below are a NOOP
    // ...
```

Code after:
          isDirty: _getDirty(name, value),
        });
      }
    } else {
      field && !field._f && !isNullOrUndefined(value)
        ? setValues(name, value, options)
        : setFieldValue(name, value, options);
    }

    isWatched(name, _names) && _subjects.state.next({});
    _subjects.watch.next({
      name,
    });
  };

  const handleChange: ChangeHandler = async (event) => {
    const target = event.target;
    let name = target.name;
    const field: Field = get(_fields, name);

    if (field) {
      let error;
      let isValid;
      const fieldValue = target.type
        ? getFieldValue(field._f)
        : getEventValue(event);
      const isBlurEvent = event.type === EVENTS.BLUR;
      const shouldSkipValidation =
        (!hasValidation(field._f) &&
          !_options.resolver &&
          !get(_formState.errors, name) &&
          !field._f.deps) ||
        skipValidation(
          isBlurEvent,
          get(_formState.touchedFields, name),
          _formState.isSubmitted,
          validationModeAfterSubmit,
          validationModeBeforeSubmit,
        );
      const watched = isWatched(name, _names, isBlurEvent);

      if (isBlurEvent) {
        field._f.onBlur && field._f.onBlur(event);
      } else if (field._f.onChange) {
        field._f.onChange(event);
      }

      set(_formValues, name, fieldValue);

      const fieldState = updateTouchAndDirty(
        name,