我使用 i18next,我想將 t 函式道具傳遞給我的界面。
經驗:
const { t } = useTranslation();
export interface ITranslate {
translate: ... type?
}
“t”變數的型別是什么?
uj5u.com熱心網友回復:
您可以使用ReturnType實用程式型別:
export interface ITranslate {
translate: ReturnType<typeof useTranslation>['t']
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/475095.html
