fix(ui): resolve theme toggle icon hydration mismatch - #9160
Merged
AugustinMauroy merged 1 commit intoSep 19, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
AugustinMauroy
approved these changes
Sep 16, 2026
canerakdas
approved these changes
Sep 19, 2026
avivkeller
approved these changes
Sep 19, 2026
moshams272
had a problem deploying
to
Storybook
September 19, 2026 15:43 — with
GitHub Actions
Failure
AugustinMauroy
enabled auto-merge
September 19, 2026 15:44
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9160 +/- ##
==========================================
- Coverage 86.15% 86.04% -0.12%
==========================================
Files 86 86
Lines 6046 6046
Branches 357 358 +1
==========================================
- Hits 5209 5202 -7
- Misses 833 840 +7
Partials 4 4 ☔ View full report in Codecov by Harness. |
Contributor
📦 Build Size ComparisonSummary
Changes🔄 Modified Routes (4)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a visual hydration mismatch bug in the
ThemeTogglecomponent, which currently causes the theme icon to get stuck onnodejs.org/learnpages (powered bydoc-kit). Other pages avoid this issue because their hydration is handled bynext-themes.By adding a
key={currentTheme}prop toTriggerIcon, we force React/Preact to remount the correct SVG node on theme changes, rather than incorrectly attempting to reuse the stale server-rendered SVG.Thanks @puneetnith28 for initially proposing this fix in webpack/webpack-doc-kit/pull/270.
Validation
Can not validate it solves it or not, but can validate the issue. As when click on
learnit always goes to thenodejs.org/learn.Related Issues
None.
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.