DEV Community

Discussion on: Using useReducer and Redux Toolkit Together: A Powerful Combination for State Management

Collapse
 
markerikson profile image
Mark Erikson

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.