Example usage
const [ t ] = useTranslation();
return <>{t`Hello`}</>
Worked in react-i18next v 11.7.4, but not 11.8.0, now errors with
No overload matches this call.
Overload 1 of 2, '(key: never, options?: string | TOptions<StringMap> | undefined): never', gave the following error.
Argument of type 'TemplateStringsArray' is not assignable to parameter of type 'never'.
Overload 2 of 2, '(key: never, defaultValue?: string | undefined, options?: string | TOptions<StringMap> | undefined): never', gave the following error.
Argument of type 'TemplateStringsArray' is not assignable to parameter of type 'never'. TS2769
Seems to be something that happened after TypeScript PR. Any ideas @pedrodurek ?
it is the same error https://github.com/i18next/react-i18next/issues/1212
it is the same error #1212
@pedrodurek I should defo debounce my questions sometimes haha :man_facepalming: :joy:
Hey @onionhammer, It should be fixed now. I added the support to template string back, but unfortunately TemplateStringsArray doesn't support generics yet (https://github.com/microsoft/TypeScript/issues/33304), so this PR https://github.com/i18next/react-i18next/pull/1193, which types all keys from t function won't work for you.
@tigerabrodi you were right! This was a different issue indeed, which was returning the same error.
Hey @onionhammer, can we close this one?
@pedrodurek seems like this leads to another breaking change/or perhaps bug; now the result of
t`Something`
is not a string, it's a TFunction
Ohh yeah, it's been handled here: https://github.com/i18next/react-i18next/issues/1217
Closing in favor if #1217
Most helpful comment
Hey @onionhammer, It should be fixed now. I added the support to template string back, but unfortunately
TemplateStringsArraydoesn't support generics yet (https://github.com/microsoft/TypeScript/issues/33304), so this PR https://github.com/i18next/react-i18next/pull/1193, which types all keys fromtfunction won't work for you.@tigerabrodi you were right! This was a different issue indeed, which was returning the same error.