Closed flyFatSeal closed 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
tree | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 9, 2024 9:44am |
此次更改主要集中在Tree
组件的逻辑上,特别是在属性和状态同步的处理方面。主要更新包括在getDerivedStateFromProps
生命周期方法中实现了更强大的属性同步机制,needSync
函数现在使用props.hasOwnProperty(name)
来检查属性的存在。此外,expandedKeys
的处理逻辑得到了优化,以确保组件根据新属性正确管理扩展状态。setUncontrolledState
方法也进行了更新,以提高状态管理过程的清晰度。拖放功能也进行了小幅调整,以确保在拖放操作中组件的行为正确。
文件 | 更改摘要 |
---|---|
src/Tree.tsx | 更新getDerivedStateFromProps 和setUncontrolledState 方法签名;优化needSync 和expandedKeys 的处理逻辑;调整onNodeDragEnter 方法以改善拖放功能。 |
🐰 在树间跳跃,乐趣无穷,
属性同步,状态更清晰,
拖放更顺畅,真是欢愉,
兔子欢舞,庆祝新变化,
让我们一起,享受这片森林的美丽! 🌳✨
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 99.84%. Comparing base (
00dc70b
) to head (8c179c8
). Report is 2 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Replace the "in" operator in Tree.tsx to avoid unnecessary prototype chain traversal behavior.
Summary by CodeRabbit