my page is connected to a redux store, like so:
export default withRouter(
connect(
mapStateToProps,
{ postResendEmailConfirmation, getEmailVerificationCheck, getPermissions }
)(Welcome))
);
After following a tutorial and adding the configuration, I have imported:
import { withNamespaces } from 'react-i18next';
but I don't how how to connect the two. I did this:
export default withRouter(
connect(
mapStateToProps,
{ postResendEmailConfirmation, getEmailVerificationCheck, getPermissions }
)(withNamespaces('translations')(Welcome))
);
but the error is:
Component.js:144 [React-imported-component] TypeError: (0 , _reactI18next.withNamespaces) is not a function
what version of react-i18next? -> latest would use withTranslation -> https://react.i18next.com/latest/migrating-v9-to-v10#components-v9-greater-than-v10
@jamuhl the version is: "react-i18next": "^10.9.0".
And now it looks like this:
export default withRouter(
connect(
mapStateToProps,
{ postResendEmailConfirmation, getEmailVerificationCheck, getPermissions }
)(withTranslation('translations'))(Welcome)
);
However, my error is now : [React-imported-component] TypeError: Cannot set property 'props' of undefined
Can't reproduce this...must be related to your code...
@jamuhl the version is: "react-i18next": "^10.9.0".
And now it looks like this:
export default withRouter(
connect(
mapStateToProps,
{ postResendEmailConfirmation, getEmailVerificationCheck, getPermissions }
)(withTranslation('translations'))(Welcome)
);
However, my error is now :[React-imported-component] TypeError: Cannot set property 'props' of undefined
You have an issue with your parenthesis: (withTranslation('translations'))(Welcome) should be (withTranslation('translations')(Welcome))
@T0nio wow...good catch on that one...
Most helpful comment
You have an issue with your parenthesis:
(withTranslation('translations'))(Welcome)should be(withTranslation('translations')(Welcome))