After following exactly the document provided here to type correctly my translation key, I hope to use t('key') with a fully typed on my translation function. But on my simple StackBlitz example, I always need to prefix my key with namespace, even if I import it correctly in useTranslation('ns1').
const TranslationItem = () => {
const { t } = useTranslation('ns1');
return (
<div>
<div>Type Error : {t('title')}</div>
<div>No Type Error : {t('ns1:title')}</div>
</div>
);
};
When I specify a namespace, I should use the simple key without prefixing with ns1:
const TranslationItem = () => {
const { t } = useTranslation('ns1');
return (
<div>
<div>Works well : {t('title')}</div>
</div>
);
};