Open ewelinam10 opened 4 months ago
Please provide a minimal reproducible example repository or codesandbox example etc... But looking at your animal.component.tsx code, it seems you are using the t() function outside of a react component? The t function needs to be executed inside a function (normally where the UI is rendered...)
maybe related: https://github.com/i18next/react-i18next/issues/909 https://github.com/i18next/react-i18next/issues/1757
🐛 Bug Report
Hello, I am facing weird bug. When I share array that contains i.a. translations between two files ( one file with component, second file with service) , those translations stop working. When I remove usage from service, and use only in one file, it is fine. Also it is working when I've change scope of this array by changing declaration from const to var. Maybe is it related to some bundling ?
To Reproduce
animal.component.tsx
animal.service.tsx
Expected behavior
Animal component shows translation for cat
Your Environment