Closed afc163 closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
picker | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 28, 2024 4:25am |
此次更改涉及 TimePanelBody
组件,主要是为 onHover
函数添加了默认值。之前,onHover
是直接从上下文中解构而来,未提供默认值,可能导致未定义行为。现在,更新后的代码为 onHover
指定了一个默认空函数,以确保即使未提供 onHover
函数,组件也能正常工作。
文件 | 更改摘要 |
---|---|
src/PickerPanel/TimePanel/TimePanelBody/index.tsx |
为 onHover 函数添加默认空函数,以防止未定义行为。 |
Objective | Addressed | Explanation |
---|---|---|
当 <PickerPanel/> 组件使用时,避免在时间面板单元格悬停时出现错误 (#869) |
✅ |
🐰 在时间面板上轻轻跃,
悬停不再有烦恼。
默认函数来相助,
错误远离,心欢笑!
代码如诗,乐无穷,
兔子欢舞,庆新功!
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?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.42%. Comparing base (
471c86b
) to head (27ec289
). Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
close https://github.com/react-component/picker/issues/869
Summary by CodeRabbit
TimePanelBody
组件添加了onHover
函数的默认值,增强了组件的健壮性,避免了因未定义的onHover
函数而导致的运行时错误。