You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I import t and use it, with a custom translations type, the return type of t is string | MyTranslationsObject instead of string
To Reproduce
In src/@types/i18next.d.ts:
// import the original type declarationsimport'i18next';consttranslations={Foo: {Bar: 'Hey'}};declare module 'i18next'{interfaceCustomTypeOptions{defaultNS: 'translation';resources: {translation: typeoftranslations};}}
In some other .ts file:
import{t}from'i18next';constfoo=t('Foo.Bar');
Expected behavior
I expected the type of foo to be string.
Your Environment
runtime version: node 18.11
i18next version: 22.4.3
os: Mac
The text was updated successfully, but these errors were encountered:
馃悰 Bug Report
When I import
t
and use it, with a custom translations type, the return type of t isstring | MyTranslationsObject
instead ofstring
To Reproduce
In
src/@types/i18next.d.ts
:In some other
.ts
file:Expected behavior
I expected the type of
foo
to bestring
.Your Environment
The text was updated successfully, but these errors were encountered: