fix: type resize callback sizes - #628
Conversation
|
@nrps9909 is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughDrawer 的尺寸回调现在接收当前尺寸参数。实现透传该参数。测试、API 文档和示例同步更新。 Changes可调整大小回调
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The resize callbacks now expose the numeric size they already receive at runtime, with focused test coverage and validation passing; no actionable merge-blocking risk remains. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #628 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 209 209
Branches 75 75
=========================================
Hits 209 209 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Please continue to refine the examples and docs. |
|
Updated in 77c44f5. The README now documents the size argument for all three resize callbacks, the resizable demo page explains the pixel-size contract, and the interactive example displays the current size plus the start/end callback values instead of only logging callback names. I revalidated TypeScript, all 5 suites / 51 tests, full source/docs/tests lint (0 errors; existing warnings only), the production dumi build, Prettier, and diff checks. |
|
This PR contains a lot of unnecessary diff due to Markdown formatting. I'd like to revert/roll back these formatting changes. |
|
Rolled back the README table formatting in 9975b0b. The PR is now limited to the callback type/runtime changes, focused regression test, and the requested resizable demo explanation/example; README.md is byte-for-byte unchanged from master. |
|
The documentation does need to be updated for this API change, but please avoid reformatting the Markdown files. Formatting changes create a large amount of unrelated diff and make the PR harder to review. Please keep the documentation changes focused on the necessary content only. |
|
Updated in |
Summary
onResizeStartonResizeEndProblem
useDragalready invokes all three resize callbacks with a numeric size, and its internal option types reflect that behavior. The publicDrawerPropsandDrawerPopupPropstypes only declaredonResizeStartandonResizeEndas() => void. A consumer that typed either callback parameter asnumbertherefore received TS2322 even though that number is supplied at runtime.The regression change fails on current master with two TS2322 errors and passes after aligning the public callback signatures with
useDrag.Validation
rc-test --runInBand(5 suites, 51 tests)tsc --noEmitsrc(no errors; 3 existing hook warnings)father build(ESM, CJS, declarations)git diff --checkI checked the current issues and open PR changed files. #591 only changes the CSSMotion ref placement, while #472 concerns mask scroll locking; no open work changes these callback signatures.
Summary by CodeRabbit
功能改进
文档
测试