State Management · Junior · Question 57 of 75
Where does the argument go when you dispatch todoAdded("Buy milk") created by createSlice?
todoAdded(state, action) {
state.push({ text: action.payload, done: false });
}- ✓Correct answer: Into
action.payload - 2Into
action.data - 3Into
state.args
Explanation
Generated action creators put their single argument into payload. A prepare callback can customize the payload, e.g. to add a generated id.