Answer the question
In order to leave comments, you need to log in
How to make changes to the Redux state, by line with the path to change?
How to make changes to the state by disspatching a string with the path of what needs to be changed and the new value?
For example, there is such a state:
const initialState = {
array: [
{
key: "value",
obj: {
key1: "value",
key2: "value",
},
array: [
{
key: "value",
obj: {
key1: "value",
key2: "value",
},
}
]
},
{
key: "value",
obj: {
key1: "value",
key2: "value",
},
},
{
key: "value",
obj: {
key1: "value",
key2: "value",
},
},
],
path: "",
value: ""
};
Answer the question
In order to leave comments, you need to log in
Umm... I didn't really understand what should come out...
Like you dispatch an action that has type, and in the editor you have to process this type, namely in the reducer, in which your initialState is, and pass the old value and it is not needed in the action, because what for it is needed there if it is written in the global state
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question