[PR #1] [MERGED] 修复: 解决服务器与客户端渲染不匹配导致的水合错误 #7

Closed
opened 2026-03-03 13:31:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/GeekyWizKid/writing-helper/pull/1
Author: @fzlzjerry
Created: 3/3/2025
Status: Merged
Merged: 3/3/2025
Merged by: @GeekyWizKid

Base: mainHead: fix-hydration-error


📝 Commits (1)

  • 1322119 修复: 解决服务器与客户端渲染不匹配导致的水合错误

📊 Changes

2 files changed (+2 additions, -7 deletions)

View changed files

📝 src/app/globals.css (+1 -6)
📝 src/app/layout.tsx (+1 -1)

📄 Description

This pull request includes changes to the theme handling in the application to ensure a consistent theme between the server and client. The most important changes are:

Theme consistency:

  • src/app/globals.css: Removed the media query for prefers-color-scheme to ensure the same theme is used on both the server and client.
  • src/app/layout.tsx: Updated the html element to explicitly set the data-theme attribute to "light" and the colorScheme style to "light".

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/GeekyWizKid/writing-helper/pull/1 **Author:** [@fzlzjerry](https://github.com/fzlzjerry) **Created:** 3/3/2025 **Status:** ✅ Merged **Merged:** 3/3/2025 **Merged by:** [@GeekyWizKid](https://github.com/GeekyWizKid) **Base:** `main` ← **Head:** `fix-hydration-error` --- ### 📝 Commits (1) - [`1322119`](https://github.com/GeekyWizKid/writing-helper/commit/1322119f9416612061a7c5aa219b1b0d55832eae) 修复: 解决服务器与客户端渲染不匹配导致的水合错误 ### 📊 Changes **2 files changed** (+2 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/app/globals.css` (+1 -6) 📝 `src/app/layout.tsx` (+1 -1) </details> ### 📄 Description This pull request includes changes to the theme handling in the application to ensure a consistent theme between the server and client. The most important changes are: Theme consistency: * [`src/app/globals.css`](diffhunk://#diff-4f206759c961f544a48464ad2ee231adc87e72593d03a0004b68c17771f7a412L13-R13): Removed the media query for `prefers-color-scheme` to ensure the same theme is used on both the server and client. * [`src/app/layout.tsx`](diffhunk://#diff-29d0a55f5ca1a9951042587f8b891bb4cd8b204f5bc855dc2468ed44cde2f5b3L26-R26): Updated the `html` element to explicitly set the `data-theme` attribute to "light" and the `colorScheme` style to "light". --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 13:31:01 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/writing-helper#7
No description provided.