You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ThemeToggle briefly shows the wrong icon on first paint because theme state initializes to "light" before the correcting effect runs #208
src/context/ThemeContext.tsx#ThemeProvider initializes React state unconditionally:
const[theme,setTheme]=useState<Theme>("light");
The actual applied theme (dark or light) is decided synchronously before hydration by
the inline themeInitScript in layout.tsx, which adds the dark class straight to <html>. ThemeProvider's useEffect then reads that class back to correct its own theme state:
Between first paint and this effect running, theme is "light" regardless of the
visitor's actual preference. src/components/ui/ThemeToggle.tsx renders its icon
directly from this state:
For a visitor whose page is actually rendering in dark mode (via a stored preference or prefers-color-scheme: dark), the toggle button shows a Moon icon (meaning "click to
go dark") for one render/paint even though the page is already dark — the icon is
momentarily backwards relative to the real state, a small but visible flash on every
page load in dark mode.
Suggested fix: read the initial theme synchronously via a lazy useState initializer
(useState<Theme>(() => document.documentElement.classList.contains("dark") ? "dark" : "light"))
instead of hardcoding "light" and correcting it after the fact — safe here since ThemeProvider is already a Client Component executing after the theme-init script
has run.
@kelvin1738-sys has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
Hello, This issue aligns well with my experience and technical skills. I'm confident I can resolve it effectively and would appreciate being assigned to it.
@Genesis000001 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
Hi, I’ve carefully gone through the issue details and fully understand the requirements. I’m confident I can deliver a clean, efficient solution that meets the acceptance criteria. Please feel free to assign it to me.
@KingDavid9999 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
Hi maintainer, I'd very much appreciate the opportunity to work on this issue.
Having reviewed the acceptance criteria, I'm confident that I'd be able to have a PR up shortly after being assigned.
Kindly assign this issue to me.
Thank you!
@Yotwesten has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
Hi Maintainer, I’m very interested in working on this issue. I have experience handling similar tasks and am confident I can contribute effectively. I’m ready to get started right away.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Yotwesten to this issue.
@johdanike has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
I can pick this up! I will fix the hydration flash in ThemeContext.tsx by using a lazy useState initializer to synchronously read the applied theme class from the document before the first paint. Having architected Next.js applications and managed complex React component lifecycles, I can seamlessly resolve this layout state mismatch. Let me know if I'm good to open a PR!
Congratulations, @richardtoms100! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @richardtoms100: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🏆 @richardtoms100: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (156 total points). Track your full progress on GrantFox.
👏 Great work, @richardtoms100! Keep contributing to MergeFi.
😎 @richardtoms100: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
Activity
codewithzubair07 commentedon Aug 24, 2026
@codewithzubair07 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @codewithzubair07 to this issue.
kelvin1738-sys commentedon Aug 24, 2026
@kelvin1738-sys has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @kelvin1738-sys to this issue.
onyekachi66 commentedon Aug 24, 2026
@onyekachi66 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @onyekachi66 to this issue.
Genesis000001 commentedon Aug 24, 2026
@Genesis000001 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Genesis000001 to this issue.
KingDavid9999 commentedon Aug 24, 2026
@KingDavid9999 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @KingDavid9999 to this issue.
abdool002 commentedon Aug 24, 2026
@abdool002 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @abdool002 to this issue.
devNuel commentedon Aug 24, 2026
@Yotwesten has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Yotwesten to this issue.
johdanike commentedon Aug 24, 2026
@johdanike has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @johdanike to this issue.
richardtoms100 commentedon Aug 24, 2026
@richardtoms100 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @richardtoms100 to this issue.
olubukolatanko209-doc commentedon Aug 24, 2026
@olubukolatanko209-doc has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @olubukolatanko209-doc to this issue.
drips-wave commentedon Aug 24, 2026
Congratulations, @richardtoms100! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @richardtoms100: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
grantfox-oss commentedon Aug 25, 2026
🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!
@richardtoms100's PR #322 was approved and merged by @chonilius.
🏆 @richardtoms100: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (156 total points). Track your full progress on GrantFox.
👏 Great work, @richardtoms100! Keep contributing to MergeFi.
drips-wave commentedon Aug 25, 2026
This issue has been completed by @richardtoms100 as part of the Stellar Wave Program's 8th Wave 🥳
😎 @richardtoms100: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
test(ThemeToggle): cover dark/light icon selection