React-i18next: v8.x: "Cannot read property 'usePureComponent' of undefined" in withNamespaces.js when nesting withNamespaces()

Created on 2 Oct 2018  ·  15Comments  ·  Source: i18next/react-i18next

Maybe withNamespaces does not pass i18nOptions through?

bug

Most helpful comment

should be fixed in [email protected] - please verify

All 15 comments

To reproduce with react_withHOC:

  1. Replace reactI18nextModule with I18nextProvider
  2. Create a new component Test.js using withNamespaces, ie:
import React from 'react';
import { withNamespaces } from 'react-i18next';

const Test = ({ t }) => (
  <div>Another description: {t('description.part2')}</div>
);

export default withNamespaces("translations")(Test);
  1. Nest it inside App.js component
  2. BAM

@raulfdm not related to that...just a problem introduced with v8...currently working on a fix.

@jamuhl ohh I see.. I downgrade to v7 and start to work again 🤔 .. thanks btw

Having the same issue. i does however pass i18nOptions.

screenshot 2018-10-02 at 10 41 53

The issue i'm facing is that props.i18n does not exist in NamespacesConsumer.js
screenshot 2018-10-02 at 10 45 10

Will downgrade for now.

should be fixed in [email protected] - please verify

Thanks! Well, this seems to be fixed but I have another bug, apparently related. Only in production, I still need some time to debug but I believe it comes from utils::initSSR(): TypeError: Cannot set property 'wait' of undefined

L26: props.i18nOptions.wait = false;

@olivierpascal should be fixed in [email protected]

That was quick!

should be fixed in [email protected] - please verify

Using 8.0.6 and cleared my caches, still getting the abovementioned error:

ExceptionsManager.js:84 Unhandled JS Exception: TypeError: TypeError: TypeError: Cannot read property 'usePureComponent' of undefined

Some context:
screen shot 2018-10-02 at 13 53 49

Using it in combination with:

    npmPackages:
      react: 16.3.1 => 16.3.1
      react-native: ~0.56.0 => 0.56.0

@pepf are you using I18nextProvider or the.use(reactI18nextModule) ?!? that really should not happen anymore...

@pepf usually when I have this weird situation I remove my node_modules and yarn.lock and install everything again. It solve's a lot of issues though 🤷‍♂️

I'm using the I18nextProvider, but I've been checking the source files, seems to be a caching issue still 😅 Thanks!

@pepf thanks for double checking -> if there is still an issue or something not working as intended let me know

getting v8 out was rather demanding - a lot changed under the hood

closing this for now....feel free to reopen if finding any other problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jadbox picture jadbox  ·  3Comments

skbhardwaj picture skbhardwaj  ·  4Comments

aniket-dalvi picture aniket-dalvi  ·  4Comments

a-barbieri picture a-barbieri  ·  4Comments

ChCosmin picture ChCosmin  ·  4Comments