fix(layout): suppress browser-extension hydration warning on <body> - #9
Conversation
… attrs Grammarly and similar extensions inject data-gr-ext-installed / data-new-gr-c-s-check-loaded onto <body> after SSR, tripping React's hydration-mismatch warning even though our markup is identical. The flag is shallow (body's own attributes only), so it silences the extension noise without masking real mismatches in children. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesBody Hydration Warning Suppression
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: one or more packages not found in the registry. Comment |
The reported hydration mismatch is not a code bug — the only differing attributes are
data-new-gr-c-s-check-loadedanddata-gr-ext-installed, which Grammarly injects onto<body>after SSR.classNamematches exactly.suppressHydrationWarningon<body>is the documented fix. It's shallow — only<body>'s own attribute diff is ignored, so real mismatches in any child component still surface.Verified: typecheck clean · lint 0 errors · build OK.
Summary by CodeRabbit