Skip to content

Prevent unstyled content during reload#22

Merged
kentcdodds merged 3 commits intomainfrom
cursor/prevent-unstyled-content-during-reload-6b6f
Jul 3, 2025
Merged

Prevent unstyled content during reload#22
kentcdodds merged 3 commits intomainfrom
cursor/prevent-unstyled-content-during-reload-6b6f

Conversation

@kentcdodds
Copy link
Member

Prevent Flash of Unstyled Content (FOUC) during client hint reloads.

The previous window.location.reload() allowed the browser to continue rendering the current page while resources were canceled, leading to a visual flash. This PR addresses it by immediately stopping DOM processing and hiding the page content before triggering the reload.

Copy link
Member Author

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it works.

@kentcdodds kentcdodds merged commit 0ef40bd into main Jul 3, 2025
4 checks passed
@github-actions
Copy link

github-actions bot commented Jul 3, 2025

🎉 This PR is included in version 1.3.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants