fix: improve theme toggle functionality in ThemeContext#75
fix: improve theme toggle functionality in ThemeContext#75HRISHIKESH-hackoff wants to merge 1 commit intoNsanjayboruds:mainfrom
Conversation
|
Appreciate you raising the PR #75 – fix: improve theme toggle functionality in ThemeContext. Good initiative on addressing the theme toggle behavior 👍 However, the related issue [Bug]: Light/Dark mode toggle not working #32 is currently assigned to @soumojit-D48. For now, let’s allow the assigned contributor to work on it. If there’s no progress from their side, you can comment on #32 requesting assignment. Once I reassign it to you, you can then link your PR (#75) to that issue properly. Thanks again for being proactive - keep that momentum going. Akshay Kumar |
|
Closing as Fixed ✅ The fix includes: Proper dark/light mode toggle implementation |
Fixes
Closes #32 - Light/Dark mode toggle not working
Description
This PR improves the theme toggle functionality in the ThemeContext to fix the issue where the dark mode toggle was not working properly.
Changes
classList.toggle()with explicitclassList.add()andclassList.remove()methods for more reliable DOM manipulationuseCallbackhook for thetoggleThemefunction to prevent unnecessary re-renders and improve performancesetThemeto use a callback function ensuring synchronous DOM updates with state changesTesting
The theme toggle should now: