github alibaba/hooks v3.9.7

5 hours ago

What's Changed

  • 🐛 Bug 修复

    • @linhf123 贡献,在 #2881 中为 useInfiniteScroll 使用 requestAnimationFrame 来更新滚动位置。
    • @lvboda 贡献,在 #2866 中修复了 useRequestready=falserunAsync 未立即返回的问题(无 pending 状态)。
    • @Arktomson 贡献,在 #2900 中为 useKeyPress 添加了旧版 key 别名以提高兼容性。
    • @guaijie 贡献,在 #2884 中修复了 useRafInterval 在执行函数内部调用 clear 无效的问题。
    • @li-jia-nan 贡献,在 #2912 中修复了相同 storage 状态导致重复渲染的问题。
  • 🛠️ 代码重构

    • @JunlinZhu-Tommy 贡献,在 #2887 中将 useUpdate 中的 useCallback 替换为 useMemoizedFn
    • @li-jia-nan 贡献,在 #2868 中进行了代码优化。
    • @nghiepdev 贡献,在 #2859 中在 useIsomorphicLayoutEffect 中使用 noop 替代 useEffect
  • 🔧 性能优化

  • 📖 文档更新

    • @huangkevin-apr 贡献,在 #2892 中为讨论组图片添加了 alt 属性以提升可访问性。

  • 🐛 Bug Fixes

    • Contributed by @linhf123, used requestAnimationFrame to update scroll position in useInfiniteScroll in #2881.
    • Contributed by @lvboda, fixed the issue where runAsync did not return immediately when ready=false (no pending) in useRequest in #2866.
    • Contributed by @Arktomson, added legacy key aliases for compatibility in useKeyPress in #2900.
    • Contributed by @guaijie, fixed the issue where calling clear inside the execution function of useRafInterval did not take effect in #2884.
    • Contributed by @li-jia-nan, fixed unnecessary re-renders when the storage state remained the same in #2912.
  • 🛠️ Code Refactoring

    • Contributed by @JunlinZhu-Tommy, replaced useCallback with useMemoizedFn in useUpdate in #2887.
    • Contributed by @li-jia-nan, performed code optimizations in #2868.
    • Contributed by @nghiepdev, used noop instead of useEffect in useIsomorphicLayoutEffect in #2859.
  • 🔧 Performance

  • 📖 Documentation Updates

    • Contributed by @huangkevin-apr, added alt attributes to discussion group images for accessibility in #2892.

New Contributors

Full Changelog: v3.9.6...v3.9.7

Don't miss a new hooks release

NewReleases is sending notifications on new releases.