Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d64ab0ced
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const content = useThemedHtml(html, serverTheme); | ||
|
|
||
| return <iframe title="Preview" srcDoc={content} {...props} />; |
There was a problem hiding this comment.
Preserve initial iframe HTML through hydration
Rendering srcDoc directly from useThemedHtml makes the first client render depend on resolvedTheme, so when the client resolves to a different theme than serverTheme (for example dark client preference vs light server HTML), the iframe markup can differ from the server output during hydration and cause mismatch/flicker. The prior state+effect flow avoided this by keeping the server HTML for the initial render and applying themed HTML after mount.
Useful? React with 👍 / 👎.
Summary
Verification