i18next“t”变量的类型是什么(TYPESCRIPT)

uni*_*e11 6 i18next reactjs react-native

我使用 i18next,我想将 t 函数 prop 传递到我的界面。

经验:

const { t } = useTranslation();

export interface ITranslate {
   translate: ... type?
}
Run Code Online (Sandbox Code Playgroud)

“t”变量的类型是什么?

小智 5

也许这会起作用:

import { TFunction } from "react-i18next";

export interface ITranslate {
   translate: TFunction
}
Run Code Online (Sandbox Code Playgroud)