State Management · Junior · Question 26 of 75
What does createSlice generate?
- ✓Correct answer: A reducer and action creators for each case reducer
- 2A React component that renders the slice state
- 3A store with DevTools and middleware
Explanation
createSlice({ name: 'todos', initialState, reducers: { added(state, action) {...} } }) returns slice.reducer and slice.actions.added with the type 'todos/added'.