Closed Robloche closed 4 years ago
You set useSuspense: false and I'm sure you do not handle the ready flag given -> so you render before ready...https://react.i18next.com/latest/usetranslation-hook#not-using-suspense
adding this when i18next is initialized solved the issue :
i18n.on("initialized", () => {
ReactDOM.render(<App />, document.getElementById('root'));
})
@andresilveirah ...just make sure you got useTranslation or withTranslation everywhere you use t
-> what you're doing is just fixing the symptoms but not solving the underlying problem of having somewhere a access to t
outside of the hook, HOC
@tonix-tuft from where you got this method initNumberFormatting? In my case, it always comes undefined.
Describe the bug I'm having a warning that I think is a false positive. I get the thousands of the following warning:
i18next.js:27 i18next::translator: key "xxx" for namespace "translation" won't get resolved as namespace was not yet loaded This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!
I think it's a false positive for 3 reasons:
init()
before callingReactDOM.render()
.Before all the warnings, the console prints this:
Occurs in following versions npm 6.12.0 react-i18next 10.13.2
OS (please complete the following information):