Files
Genarrative/apps
lhk229 c489c92084
Project CI / Frontend tests (pull_request) Successful in 3m43s
Project CI / Repository checks (pull_request) Failing after 12s
Project CI / Backend tests (pull_request) Failing after 12s
Project CI / Native shell tests (pull_request) Successful in 14m6s
修复澄清自由输入把整页打进 error boundary
澄清卡片的自由回答输入框在 setAnswers 的 updater 里读
event.currentTarget.value。React 在事件派发结束后会把 currentTarget
置空,而 updater 要等渲染阶段才跑,读到的就是 null,抛出
"Cannot read properties of null (reading 'value')"。异常出在渲染阶段,
被 AuthenticatedClient 的 error boundary 接住,整页被换成
"客户端页面加载失败"。

手动输入、以及先选中选项再删除填充文本,走的都是这一个 onChange。

改成在事件里先取出 value 再交给 updater。新增的回归测试在 StrictMode
下渲染卡片(与 main.tsx 一致),覆盖这两条路径。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 15:36:02 +00:00
..