Reputation: 51
Hello. I a troubleshoot with react-i18next for translate my app, during the import i18n.js in index.js, I a type error. I m not expert ReactJs and i not resolved this trouble with success, i need help please. Thanks
import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; import Backend from 'i18next-xhr-backend'; import LanguageDetector from 'i18next-browser-languagedetector'; i18n .use(Backend) .use(LanguageDetector) .use(initReactI18next) .init({ fallbackLng: 'en', debug: true, interpolation: { escapeValue: false, } }); export default i18n;
-> export var I18nContext = React.createContext();
"Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_3_react___default.a.createContext is not a function"
Upvotes: 3
Views: 8135
Reputation: 565
It is actually a version miss match so updating the your react-dom, react & redux packages would solve the issue
npm update react react-dom
Upvotes: 2
Reputation: 51
run npm install react@latest
and npm install react-dom@latest
its worked for me
In package.json now reads
"react": "^16.8.6", "react-dom": "^16.8.6"
Visit https://github.com/hasura/react-check-auth/issues/7#issuecomment-484208398
Upvotes: 2