Repository: react-hook-form/react-hook-form
File: src/types/controller.ts (TypeScript)

Code before:
    : TResult;
  name: TName;
  ref: RefCallBack;
};

export type UseControllerProps<
  TFieldValues extends FieldValues = FieldValues,
  TResult = any,
  TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue<
    TFieldValues,
    TResult
  >,
> = {
  name: TName;
  rules?: Omit<
    RegisterOptions<TFieldValues, TName>,
    'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled'
  >;
  shouldUnregister?: boolean;
  defaultValue?: IsAny<TResult> extends true
    ? FieldPathValue<TFieldValues, TName>
    : TResult;
  control?: Control<TFieldValues>;
};

export type UseControllerReturn<
  TFieldValues extends FieldValues = FieldValues,
  TResult = any,
  TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue<
    TFieldValues,
    TResult
  >,
> = {
  field: ControllerRenderProps<TFieldValues, TResult, TName>;
  formState: UseFormStateReturn<TFieldValues>;
  fieldState: ControllerFieldState<TFieldValues, TName>;
};

export type ControllerProps<
  TFieldValues extends FieldValues = FieldValues,
  TResult = any,
  TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue<
    TFieldValues,
    TResult
  >,
> = {
  render: ({
    field,
    fieldState,
    formState,
  }: {

Review comment (suggestion):
Does `ControllerRenderProps` and `UseControllerProps` type need `TResult` ?
I think that `TResult` can be infer from `TName` 👀 

As follows: 

```ts
export type ControllerRenderProps<
  TFieldValues extends FieldValues = FieldValues,
  TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue<
    TFieldValues
  >,
> = {
  onChange: (...event: any[]) => void;
  onBlur: () => void;
  value: TName extends FieldPathWithValue<TFieldValues, infer TResult>
    ? IsAny<TResult> extends true
      ? FieldPathValue<TFieldValues, TName>
      : TResult
  : FieldPathValue<TFieldValues, TName>;
  name: TName;
  ref: RefCallBack;
};
```

Code after:
    TFieldValues,
    TResult
  >,
> = {
  invalid: boolean;
  isTouched: boolean;
  isDirty: boolean;
  error?: ControllerFieldError<TFieldValues, TResult, TName>;
};

export type ControllerRenderProps<
  TFieldValues extends FieldValues = FieldValues,
  TResult = any,
  TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue<
    TFieldValues,
    TResult
  >,
> = {
  onChange: (...event: any[]) => void;
  onBlur: () => void;
  value: IsAny<TResult> extends true
    ? UnpackNestedValue<FieldPathValue<TFieldValues, TName>>
    : UnpackNestedValue<TResult>;
  name: TName;
  ref: RefCallBack;
};

export type UseControllerProps<
  TFieldValues extends FieldValues = FieldValues,
  TResult = any,
  TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue<
    TFieldValues,
    TResult
  >,
> = {
  name: TName;
  rules?: Omit<
    RegisterOptions<TFieldValues, TName>,
    'valueAsNumber' | 'valueAsDate' | 'setValueAs' | 'disabled'
  >;
  shouldUnregister?: boolean;
  defaultValue?: IsAny<TResult> extends true
    ? UnpackNestedValue<FieldPathValue<TFieldValues, TName>>
    : UnpackNestedValue<TResult>;
  control?: Control<TFieldValues>;
};

export type UseControllerReturn<
  TFieldValues extends FieldValues = FieldValues,
  TResult = any,
  TName extends FieldPathWithValue<TFieldValues, TResult> = FieldPathWithValue<