DEV Community

Mayank Roy
Mayank Roy

Posted on

πŸš€ DevConnect Progress

βœ… 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)