L
L
letMeDie2019-06-10 15:18:26
JavaScript
letMeDie, 2019-06-10 15:18:26

Why is the reducer not working?

case SET_USERS: {
            return {
                ...state,
                users: [...state.users, ...action.value]
            }
        }

There is such a reducer, it should work on the rendering of the component, but for some reason it does nothing, the object itself is defined normally, but the state itself does not change for some reason, HELLP

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
javanub, 2019-06-12
@javanub

Try adding default to switch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question