-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revert: ref back of func #64
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
概述本次变更主要涉及对 CSSMotionRef 接口中 变更
可能相关的 PRs
诗
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #64 +/- ##
=======================================
Coverage 98.47% 98.47%
=======================================
Files 11 11
Lines 394 394
Branches 106 108 +2
=======================================
Hits 388 388
Misses 6 6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/CSSMotion.tsx (1)
174-181
: 实现更改:更新了 getter 方法的返回值getter 实现正确地返回了函数,保持了与接口定义的一致性。不过建议添加函数名以提高可读性。
建议这样修改实现:
inMotion: { enumerable: true, - get: () => () => getStatus() !== STATUS_NONE, + get: () => function checkInMotion() { + return getStatus() !== STATUS_NONE; + }, }, enableMotion: { enumerable: true, - get: () => () => supportMotion, + get: () => function checkEnableMotion() { + return supportMotion; + }, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/CSSMotion.tsx
(2 hunks)tests/StrictMode.spec.tsx
(2 hunks)
🔇 Additional comments (2)
src/CSSMotion.tsx (1)
19-23
: 接口更改:将布尔属性转换为函数接口定义的改动符合最佳实践,通过将属性转换为函数可以:
- 确保每次访问都能获取最新状态
- 避免闭包陷阱
- 使 API 的计算成本更加明确
tests/StrictMode.spec.tsx (1)
46-63
: 测试用例更新:正确使用了新的函数调用方式测试用例已正确更新以适应接口变更,现在通过函数调用来检查状态而不是直接访问属性。这些改动确保了测试的有效性。
Summary by CodeRabbit
重构
测试
此次更新改进了动态动画效果的内部逻辑,提升了动画切换的稳定性和一致性,同时调整了测试以验证这些改进。