-
Notifications
You must be signed in to change notification settings - Fork 32
[PB-4905]: Fix white screen blink on page load #1682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…diately The theme was being applied after React mounted, causing a visual flash. This fix adds an inline script in index.html that applies the dark mode class synchronously during page load, before React initialization. Also persists the isDark state properly using JSON.parse() instead of string comparison.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying drive-web with
|
| Latest commit: |
c93569a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://620cd351.drive-web.pages.dev |
| Branch Preview URL: | https://fix-white-screen-blink.drive-web.pages.dev |
src/app/theme/ThemeProvider.tsx
Outdated
|
|
||
| const toggleTheme = (theme: Theme) => setCurrentTheme(theme); | ||
|
|
||
| const persistIsDark = (value: boolean) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the name persistIsDark is a bit confusing; you need to know what isDark is. persistDarkTheme makes it clearer what it does: persist the dark theme.
|



Description
The theme was being applied after React mounted, causing a visual flash. This fix adds an inline script in index.html that applies the dark mode class synchronously during page load, before React initialization. Also persists the isDark state properly using JSON.parse() instead of string comparison.
Related Issues
Related Pull Requests
Checklist
Testing Process
Additional Notes