State Management · Middle · Question 15 of 75

What is extraReducers in createSlice for?

Explanation

reducers creates the slice's own actions, while extraReducers reacts to external ones: builder.addCase(fetchUser.fulfilled, ...) or builder.addCase(logout, () => initialState).

Further reading

Problem with a question

State Management · Middle · question 15

Test yourself

Take the State Management · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz