Continuing Redux Toolkit – Getting Hands-On (Day-12)
Catching Up with Redux Toolkit – Making Things Click
After yesterday's deep dive into the theory of Redux Toolkit, today was all about filling in the gaps and getting some hands-on practice.
Some tasks were left unfinished yesterday — especially around practical implementation — so I focused on applying what I learned by setting up a Redux Toolkit-powered app from scratch.
What I Did Today:
Redux Toolkit Implementation:
-
Revisited
configureStore()
and understood how to register multiple slices -
Implemented a working counter slice using
createSlice()
-
Practiced dispatching actions like
increment
,decrement
, andreset
-
Connected Redux state with UI using
useSelector
-
Created a separate slice for a dummy user list to simulate real-world structure
Folder Structure & Best Practices:
-
Organized the Redux files into folders:
/store
,/features
,/slices
-
Learned about keeping slice logic clean and separating concerns
Key Learnings:
-
The
createSlice()
API really simplifies managing state logic in one file -
Middleware like Redux DevTools helps in tracking actions and debugging
-
Multiple slices can be combined inside
configureStore()
as separate reducers -
Using Selector and Dispatch properly ensures a smooth and clean data flow between components
A Challenge I Faced:
How to manage multiple slices and use their state separately in different components?
At first, I was confused about how slices would interact and how useSelector
would know which one to access. After re-reading the Redux Toolkit docs and testing manually, I realized that each slice is mapped to a unique key in the store, which is then accessed like:
Gracias:
I’m thankful for the extra day to catch up — and honestly, that pause helped reinforce my learning.
~ Sanya
Comments
Post a Comment