I use i18next and I want to pass the t function prop to my interface.
exp:
const { t } = useTranslation();
export interface ITranslate {
translate: ... type?
}
what is the type of the " t " variable ?
CodePudding user response:
You can use ReturnType
utility type:
export interface ITranslate {
translate: ReturnType<typeof useTranslation>['t']
}