I have a react reducer function and ı tried to change the data with an incoming object. İf id equal change the boolean state value but it does not change.
One thing you can try is just adding a console.log(user.id, action.payload.is) above your if statement and see if those two numbers are ever matching up. Maybe the bug is happening somewhere else
A lot of times if you get a situation where you’re trying to flip a boolean and it gets “stuck” on false or true it can mean that you’re updating the value twice but you just don’t realize it. So every time it flips it just flips right back but it’s too fast for you to notice without debugging or adding some console logs
Basically you’re looking to see if the object is what you expect it to be at each point in time.
Is it starting with user.isComplete as true when it comes in? Or is it false. Do you expect it to flip? Does it flip when you expect it to?
Are you seeing the reducer fire more than once when you expect it to only fire one time?
You just have to keep asking yourself questions like that and explore what’s actually happening. Once you find something that seems odd you can use that piece of information to figure why it’s doing something you don’t expect.