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.

changeLanguage cause warning

See original GitHub issue

changeLanguage cause warning and has no effect

warning.js:36 Warning: setState(…): Cannot update during an existing state transition (such as within render or another component’s constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to componentWillMount.e @ warning.js:36 r @ warning.js:60 i @ ReactUpdateQueue.js:55 enqueueSetState @ ReactUpdateQueue.js:201 o.setState @ ReactComponent.js:64 onI18nChanged @ translate.js:104 (anonymous function) @ EventEmitter.js:51 emit @ EventEmitter.js:50 addResource @ ResourceStore.js:94 saveMissing @ BackendConnector.js:323 translate @ Translator.js:183 t @ i18next.js:321 fixedT @ i18next.js:313 render @ index.jsx:23 _renderValidatedComponentWithoutOwnerOrContext @ ReactCompositeComponent.js:808 _renderValidatedComponent @ ReactCompositeComponent.js:835 _updateRenderedComponent @ ReactCompositeComponent.js:759 _performComponentUpdate @ ReactCompositeComponent.js:739 updateComponent @ ReactCompositeComponent.js:658 receiveComponent @ ReactCompositeComponent.js:552 receiveComponent @ ReactReconciler.js:126 _updateRenderedComponent @ ReactCompositeComponent.js:761 _performComponentUpdate @ ReactCompositeComponent.js:739 updateComponent @ ReactCompositeComponent.js:658 performUpdateIfNecessary @ ReactCompositeComponent.js:566 performUpdateIfNecessary @ ReactReconciler.js:158 u @ ReactUpdates.js:151 perform @ Transaction.js:138 perform @ Transaction.js:138 perform @ ReactUpdates.js:90 w @ ReactUpdates.js:173 closeAll @ Transaction.js:204 perform @ Transaction.js:151 batchedUpdates @ ReactDefaultBatchingStrategy.js:63 s @ ReactUpdates.js:201 o @ ReactUpdateQueue.js:25 enqueueSetState @ ReactUpdateQueue.js:210 o.setState @ ReactComponent.js:64 onI18nChanged @ translate.js:104 (anonymous function) @ EventEmitter.js:51 emit @ EventEmitter.js:50 addResourceBundle @ ResourceStore.js:125 loaded @ BackendConnector.js:133 (anonymous function) @ BackendConnector.js:240 (anonymous function) @ BackendConnector.js:173 (anonymous function) @ index.js:104 (anonymous function) @ index.js:67 tryToString @ fs.js:449 readFileAfterClose @ fs.js:436

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
zaaackcommented, Oct 3, 2016

I think I might find out the reason, I didn’t wrote all locale strings in develop and when the i18next find missing keys, somehow triggered change language event, which caused set state in renderer and this warning…this is not a issue anyway.

0reactions
jamuhlcommented, Oct 3, 2016

ok thanks for further investigation

Read more comments on GitHub >

github_iconTop Results From Across the Web

False warning about accessing t function before calling init #977
changeLanguage ("another-LNG") then i18next executes the callback of languageChanged and this time formatting is set properly. I need to set up ...
Read more >
how to handle getting too many warning in console for i18n ...
changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!` reactjs · typescript · i18next · react-i18next.
Read more >
Temporarily change language for terminal messages ...
Specifying an invalid / non-installed locale name causes fallback to the POSIX locale and therefore US English. Footnotes. [1] The reasons that ...
Read more >
Windows Server 2016 (Azure) Display Language Change ...
1 Answer 1 · Download and extract the Psping tool to a local folder in the VM that does not activate. · Go...
Read more >
A Guide to React Localization with i18next | Phrase
Our app's active language, set via the lng config option or i18n.changeLanguage() , can be anything we want regardless of the set supportedLngs...
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