3

I have code for last 2 months and everything worked fine until few days back, I removed all my modules and did npm install again. Now react-intl started throwing an error when I change language in my dropdown. In my App.js I have something like this:

let { params, locale, route } = this.props;

const lc = locale || params.lc || 'en';
const translation = translations[lc] || translations.en

<IntlProvider locale={lc} messages={translation.messages}>
     {this.props.children}
</IntlProvider>

And In my language component, on dropdown change I'm changing locale. When I console log lc, and messages before I get correct lc returned and array with translated messages, then error is thrown, as you can see on img: enter image description here

The version I used in project is "2.0.0-beta-2" but it looks like it was updated without changing version number.

Anyone have an idea what happened? Thanks

Markuz Shultz
  • 678
  • 3
  • 9
  • 22

0 Answers0