β Added Like toggling β users can now like/unlike posts, stored in Redux
π Refactored how Dashboard fetches posts
π‘ Introduced new LikeButton component for consistent UI across app
π€― My biggest headache?
Turns out the root cause was a damn route spelling mistake (/post instead of /posts) β yeah, wasted HOURS on that one. π« And if that wasnβt enough, the like state wasnβt updating instantly in the UI due to a mixβup between React component state and Redux state. Figuring that out taught me so much about state flow and debugging in React + Redux .
β Why it matters
- Centralized state with Redux ensures like counts are always accurate and consistent.
- A reusable LikeButton simplifies future maintenance and styling.
- Cleaner fetch logic = fewer bugs and better performance.
π― Whatβs next?
- Improve real-time UI updates (optimistic rendering when liking/unliking)
- Add feedback/loading indicators around like actions
- Build out comments feature next π§
π¬ I'd love your insights:
Ever spent hours debugging a typo route issue? How did you stop that cycle?
How do you handle global vs component state for UI vs data?
Your tips or stories would be amazing to hear!
Top comments (0)