hydration-safe-inputs
✓修复 React 水合问题,即当 React 接管时,用户在水合之前键入的输入会被擦除/清除。在以下情况下使用:(1) 用户报告页面加载时输入字段被清除,(2) 使用已控制输入的 SSR/SSG React 应用程序(Next.js、Remix、Astro),(3) 审核表单的水合安全性,或 (4) 在静态渲染的 React 应用程序中构建新表单。
SKILL.md
In SSR/SSG React apps, there's a window between when HTML renders and when React hydrates. If a user types into an input during this window, React's hydration will wipe their input because React initializes state to the default value (usually empty string).
Initialize state by reading the DOM element's current value instead of a hardcoded default:
Search for these patterns that indicate potential hydration wipe issues:
修复 React 水合问题,即当 React 接管时,用户在水合之前键入的输入会被擦除/清除。在以下情况下使用:(1) 用户报告页面加载时输入字段被清除,(2) 使用已控制输入的 SSR/SSG React 应用程序(Next.js、Remix、Astro),(3) 审核表单的水合安全性,或 (4) 在静态渲染的 React 应用程序中构建新表单。 来源:ethanniser/hydration-test。
可引用信息
为搜索与 AI 引用准备的稳定字段与命令。
- 安装命令
npx skills add https://github.com/ethanniser/hydration-test --skill hydration-safe-inputs- 分类
- </>开发工具
- 认证
- ✓
- 收录时间
- 2026-02-04
- 更新时间
- 2026-02-18
快速解答
什么是 hydration-safe-inputs?
修复 React 水合问题,即当 React 接管时,用户在水合之前键入的输入会被擦除/清除。在以下情况下使用:(1) 用户报告页面加载时输入字段被清除,(2) 使用已控制输入的 SSR/SSG React 应用程序(Next.js、Remix、Astro),(3) 审核表单的水合安全性,或 (4) 在静态渲染的 React 应用程序中构建新表单。 来源:ethanniser/hydration-test。
如何安装 hydration-safe-inputs?
打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/ethanniser/hydration-test --skill hydration-safe-inputs 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用
这个 Skill 的源码在哪?
https://github.com/ethanniser/hydration-test
详情
- 分类
- </>开发工具
- 来源
- skills.sh
- 收录时间
- 2026-02-04