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.

Isn't this supposed to work with react + redux?

See original GitHub issue

Hi @jamuhl ,

Isn’t react-i18next supposed to work with react redux? For some reason, while I do:

export default class Root extends Component {
  render() {
    const { store, history } = this.props;
    return(
    <I18nextProvider i18n={i18n}>
      <Provider store={store}>
        <Router history={history} routes={routes} />
      </Provider>
    </I18nextProvider>
    );
  }
}

t is not passed via this.props and I am getting that t is undefined. Most likely I am missing something here and I am initializing I18nextProvider incorrectly , but still… do you have any idea/suggestion?

Thanks in advance,

KR,

Ricco

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
jamuhlcommented, Aug 19, 2017

The provider does only pass i18n instance to to context - you need to use the translate hoc to pass t to your components. https://react.i18next.com/components/translate-hoc.html

1reaction
Ricco1commented, Aug 30, 2017

Unfortunately this project is not available to public as it is protected by NDA 😕, but I will try at least the example project, though I am quite sure that it will work (for that reason we have examples 😃 )

KR,

Ricco

Read more comments on GitHub >

github_iconTop Results From Across the Web

When (and when not) to use Redux - LogRocket Blog
Don't get me wrong; React is great alone. Yes, it's possible to write a complete application using nothing but a framework. But as...
Read more >
Redux Fundamentals, Part 5: UI and React
React lets you describe your UI as a function of your state, and Redux contains state and updates it in response to actions....
Read more >
React-Redux - Why isn't my state maintaining following ...
Your reducer should return an object, not an array. const MyName = (state = {}, action) => { console.log("REDUCER - action.
Read more >
Redux vs. React Context: Which Should You Use? - fireup.pro
At the time of writing this article, the interface of Context API isn't optimized for high-frequency updates. You can face this issue when ......
Read more >
Do React Hooks Replace Redux?. TL;DR - Medium
You can and should use React hooks to get deterministic state updates, but that's ... “Does determinism break if everything isn't in Redux?...
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