You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.
Issue setupCognito doesn't seem to play nicely with Redux's applyMiddleware, resulting in a Redux state mutation error.
Steps to reproduce:
Import applyMiddleware from redux.
Call createStore, passing a call to applyMiddleware (which can be passed any middleware).
Call setupCognito.
Symptom
This results in the following error:
Uncaught Error: A state mutation was detected between dispatches, in the path cognito.userPool.client.api.operations.addCustomAttributes.input.defaultValue. This may cause incorrect behavior. (http://redux.js.org/docs/Troubleshooting.html#never-mutate-reducer-arguments)
at invariant (browser.js:40)
at index.js:53
at Object.dispatch (index.js:14)
at setupCognito (react-cognito.js:1191)
at index.js:16
The error seems triggered by the call to setupCognito.
The text was updated successfully, but these errors were encountered:
I'm not sure yet why this is only happening when using applyMiddleware, but I'm pretty sure you shouldn't store a class instance (cognito.userPool) in state since its properties are inherently mutable by its own methods (and thus, mutations can happen outside of a reducer).
Issue
setupCognito
doesn't seem to play nicely with Redux'sapplyMiddleware
, resulting in a Redux state mutation error.Steps to reproduce:
applyMiddleware
fromredux
.createStore
, passing a call toapplyMiddleware
(which can be passed any middleware).setupCognito
.Symptom
This results in the following error:
The error seems triggered by the call to
setupCognito
.The text was updated successfully, but these errors were encountered: