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
So I think the issues comes down to recomputeStates in devTools.js Basically because recomputeStates provides a completely new state any check to see if the state has changed for object and arrays will falsely return true. Let me give you an example.
var initialState = {
mySet: new Set(),
};
var anyAction = (o) => {
return {
type: 'something',
}
};
var reducer = (state=initialState, action) => {
switch(action.type) {
case'something':
return {
...state,
}
}
};
// Somewhere in some react component
componentWillReceiveProps(nextProps) {
if (nextProps.mySet != this.props.mySet) {
this.props.dispatch(anyAction());
}
}
Because recomputeStates, builds a new state object, nextProps.mySet will change with every action, thus dispatching anyAction will cause an infinite loop.
The text was updated successfully, but these errors were encountered:
So I think the issues comes down to recomputeStates in devTools.js Basically because recomputeStates provides a completely new state any check to see if the state has changed for object and arrays will falsely return true. Let me give you an example.
Because recomputeStates, builds a new state object, nextProps.mySet will change with every action, thus dispatching anyAction will cause an infinite loop.
The text was updated successfully, but these errors were encountered: