When using react-hook-form with Typescript, there is a component that sends some props, register being one of them.
The issue is with its type when declared in an interface:
export interface MyProps {
title: string;
...
register: (string | undefined) => void;
}
Which is the correct way of declaring register here?
Also tried with:
import { RegisterOptions } from 'react-hook-form';
export interface MyProps {
title: string;
...
register: RegisterOptions;
}