question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use this library when using redux?

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
T0niocommented, May 7, 2019

@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))

2reactions
jamuhlcommented, Apr 30, 2019

what version of react-i18next? -> latest would use withTranslation -> https://react.i18next.com/latest/migrating-v9-to-v10#components-v9-greater-than-v10

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux Fundamentals, Part 5: UI and React
Redux is a standalone JS library. As we've already seen, you can create and use a Redux store even if you don't have...
Read more >
Understanding Redux: A tutorial with examples
In this tutorial, we'll show you what Redux is, why you should use it, and how it works. We'll demo using a simple...
Read more >
I wonder if I can have a redux store in the library and the App ...
Yes it is possible. To keep it simple, library is completely independent package where you can use the redux in ...
Read more >
Introduction to React Redux Library
In this lesson, we will learn how to use the React Redux library, which contains the official bindings for adding Redux to a...
Read more >
Setting up the 'react-redux' library - Thinkster.io
The react-redux module is the "official bindings" between react and redux. It adds some useful syntactic sugar for binding your components to your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found