-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'ready' of null in some cases #615
Comments
Got no problem with being guilty 😁... but if this does not happen in material-ui 1.0.0 why not just update to that. my guess is the dialog, popover component using some portal implementation to place the component out of the current render tree not copying over the context or whatever...but anyway call me guilty 😄 If you find anything we could change to make this work anyway without making a complete rewrite i would be happy to accept a PR. |
upgrading material-ui is time consuming. I'm continuing right now without other solution but this work was not expected so it's quite a pain. Thanks. |
By the way, how is it that there was no problem before v8? |
change your i18n.js: import i18n from "i18next";
import { reactI18nextModule } from "react-i18next";
i18n
.use(reactI18nextModule)
.init({
fallbackLng: "en",
load: "languageOnly",
ns: ["common"],
defaultNS: "common",
react: {
wait: true,
nsMode: "default"
}
});
export default i18n; and remove the |
Seems the |
If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project -> there are many ways to help this project 🙏 |
I am getting same error as well. App.js
|
@WebMobi59 can you make a more complete sample like @nicgirault did - so I have a chance to reproduce and help? |
@jamuhl thanks for your quick reply. Please let me know if you need more info. |
@WebMobi59 i see...the sample does not really work so there is no change for me to reproduce... actually you're passing the translations in...could you point me to the line throwing that i guess it's that one...https://github.com/i18next/react-i18next/blob/master/src/NamespacesConsumer.js#L146 but makes not much sense that state is null |
@jamuhl yes, I am getting error at line 69. |
I am referring issue #572 , but no luck yet. |
will try something...will make a new version guarding against unset state ... my guess is the cause is this: https://github.com/i18next/react-i18next/blob/master/src/NamespacesConsumer.js#L11 |
could you please retry with: [email protected] |
@jamuhl I solved this issue by importing i18n.js file. |
hm...so you just had the i18n.js file around but not imported. That should cost you starring this repo twice 😄 |
I am actually facing the same problem but while running unit test on my component. Can you please help regarding this? I am getting this as the error "TypeError: Cannot read property 'wait' of null at NamespacesConsumerComponent.render (node_modules/react-i18next/dist/commonjs/NamespacesConsumer.js:213:33)" This is my test component. I couldnt share the whole code as its part of a big project. `
` |
@nabiltkarim using [email protected] ? not getting a warning no i18n instance is passed around?!? There is no i18n.js loaded no i18n instance passed by i18n.use(reactI18nextModule) -> so that will not work...have a look at: https://github.com/i18next/react-i18next/tree/master/example/test-jest for testing |
Yes using [email protected]. i passed i18n.js following the way you guys did in your last push to this repository. Do i need to create the mock react-i18next and pass i18n.js again inside my test component? Sorry I am doing unit testing for the first time using this thats why I am very confused. |
It needs the instance - mock or real...not having that it will not work...don't worry...follow the JEST sample and/or read https://react.i18next.com/misc/testing |
It worked somewhat. Thank you for all the prompt replies and help :) |
I get an error when using react-i18next in [email protected] dialogs and popover. This bug is not happening in material-ui > 1.0.0 so I don't know who is guilty.
Here is a reproducable example https://codesandbox.io/s/qqor2zv7r4
The text was updated successfully, but these errors were encountered: