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
After upgrading i18next to latest version from 20.x.x version, t('ns:key', { count: 1 }) function with count option always returns value with type never (on version 20.x.x - string as expected)
To Reproduce
{
"key_one": "value",
"key_other": "values"
}
const{ t }=useTranslation(['common']);constvalue=t('common:key',{count: 10});// type of value - `never`
I would expect string type of returning value t('common:key', { count: 10 })
const{ t }=useTranslation(['common']);constvalue=t('common:key',{count: 10});// type of value - `string`
Your Environment
runtime version: node v14
i18next version: 21.6.6
react-i18next: 11.15.3,
os: Mac
The text was updated successfully, but these errors were encountered:
wolkyura
changed the title
t function with plurals return type never after migrating to v21.x.x
t function with plurals returns type never after migrating to v21.x.x
Feb 16, 2022
🐛 Bug Report
After upgrading
i18next
to latest version from20.x.x
version,t('ns:key', { count: 1 })
function with count option always returns value with typenever
(on version20.x.x
-string
as expected)To Reproduce
react-18next.d.ts
:i18n.ts
:Expected behavior
I would expect
string
type of returning valuet('common:key', { count: 10 })
Your Environment
The text was updated successfully, but these errors were encountered: