DEV Community

Discussion on: How to build a Fabulous Todo App using React, Redux and Framer-Motion

 
mb20 profile image
Mb20

I checked redux-toolkit.js.org/api/createslice, says createSlice automatically generates the action types and creators that correspond to reducers and state. I think this answered all my questions, in component DisplayTodos, we import addTodos as action creator which will take payload as parameter and return action object. I thought they are reducer functions.

Thread Thread
 
codebucks profile image
CodeBucks

Great that you figured it out yourself🍻, Yes redux-toolkit is a different than simple approach, It will do all the things by itself within createSlice function so we don't have to write more boilerplate code. 😄