Yep, that's one of the great things about reducer functions - they're just functions! Doesn't matter how they're implemented inside, you just call them with (state, action) and get a new state back as a result.
That's also one of the reasons why we've designed RTK as a "toolkit" - you can pick and choose the pieces you need for the problem you're trying to solve, and that includes using createSlice with useReducer even if you don't have a Redux store in your app.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yep, that's one of the great things about reducer functions - they're just functions! Doesn't matter how they're implemented inside, you just call them with
(state, action)and get a newstateback as a result.That's also one of the reasons why we've designed RTK as a "toolkit" - you can pick and choose the pieces you need for the problem you're trying to solve, and that includes using
createSlicewithuseReducereven if you don't have a Redux store in your app.