Conversation
- pickAttrs: forward new React DOM event handlers (onEnter, onExit, onShare, onUpdate) added in newer @types/react - hooks-17 useId: assert generated id pattern instead of a fixed index, since React StrictMode effect double-invocation varies across React versions
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough本次变更更新两个测试。水合测试匹配动态生成的唯一标识。 Changes测试断言调整
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to The PR only adjusts test assertions for dependency-compatible behavior and is mergeable. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 小兔检查水合灯, Comment |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #815 +/- ##
=======================================
Coverage 86.77% 86.77%
=======================================
Files 41 41
Lines 1096 1096
Branches 382 389 +7
=======================================
Hits 951 951
Misses 143 143
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ Preview is ready!
↩️ Previous: ⚡️ 🤖 Powered by surge-preview |
|||||||||||||||
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified; the remaining finding is a minor cleanup nit.
Pull request overview
Fixes two pre-existing React 19 test failures.
Changes:
- Expands
pickAttrsevent-handler support. - Makes the fallback ID test version-independent.
File summaries
| File | Changes | Review notes |
|---|---|---|
tests/hooks-17.test.tsx |
Validates fallback IDs by pattern. | Nit: remove unused matchId helper. |
src/pickAttrs.ts |
Adds four event names to the whitelist. | — |
Review details
Suppressed comments (1)
tests/hooks-17.test.tsx:57
- The exact-id assertion was replaced, but the
matchIdhelper above this test is now unused (it has no other references in this file). Please remove the dead helper so the test does not retain stale code that can confuse future maintenance.
// React StrictMode may double-invoke effects across versions, so only
// assert a generated id instead of a fixed index.
const ele = container.querySelector('.target');
expect(ele.id).toMatch(/^rc_unique_\d+$/);
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
这个 PR 在做什么这个 PR 修复依赖升级后的两处测试失败:放宽 React 17 fallback ID 的断言,并向 结论不适合合并 需要撤回四个回调名的白名单变更,并修正测试的事件提取逻辑。否则会把非 DOM 回调错误透传给原生节点。 问题清单🔴 高优先级(阻塞合并)
🟡 中优先级(建议修复)无。 🟢 低优先级(可选改进)
|
…ibutes - Revert adding onEnter/onExit/onShare/onUpdate to pickAttrs eventsName: they are ViewTransitionProps callbacks, not DOM event handlers - Extract React DOM event list only from the DOMAttributes interface block instead of scanning the whole index.d.ts - Remove unused matchId helper in hooks-17 test
|
感谢指正,确认是问题 ✅
已在 6198688 修复:
本地 |

Background
PR #806 and other recent PRs show failing
testchecks, but the failures are pre-existing on master (reproduced locally by checking out master and runningrc-test). They are caused by dependency updates (React 19.2.x / newer@types/react) merged after the last green master test run, not by any specific PR.Failures fixed
utils › pickAttrs › forwards every React DOM event handler@types/reactnow declaresonEnter,onExit,onShare,onUpdateas DOM event handlers. Added them to theeventsNamewhitelist inpickAttrsso they are forwarded.hooks-17 › useId › fallback of React 17 or lowerThe fallback id index differs across React versions because StrictMode effect double-invocation behavior changed. The test now asserts the generated id pattern (
/rc_unique_\d+/) instead of a fixed index.Verification
npx rc-test: 30 suites / 197 tests passed (1 skipped) on this branch, while master fails the two tests above.Summary by CodeRabbit