Answer the question
In order to leave comments, you need to log in
Why action changes wrong fields in state redux?
Essence of the question. There is an Action SET_USER_PREVIEW which has an object with information about the user in its payload.
In the reducer, I put this information in the state. For state, I only change one field (currentUser),
but reduxDevToll shows that I have changed several fields. Why is this happening
Answer the question
In order to leave comments, you need to log in
You are changing not just currentUser, but messageReduser.currentUser. Well, that is, messageReduser also changes.
Yes, redux, immutability, that's all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question