Answer the question
In order to leave comments, you need to log in
Adding a new object to state, is it a mutation?
I want to make something like a stack where new data will be added:
case SET_STACK:
state[action.name] = {
use: action.use,
title: action.title,
tab: action.tab
}
return state
Answer the question
In order to leave comments, you need to log in
This is a mutation, you must return a new state.
make a stack history of the state and that's it, and in the store always return the new state
Use for example
return {...state ,
use: action.use,
title: action.title,
tab: action.tab
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question