changeLanguage cause warning
See original GitHub issuechangeLanguage 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:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
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.
ok thanks for further investigation