Releases: alibaba/hooks
Releases · alibaba/hooks
v2.4.0
v2.3.0
v2.2.0
- ✨ Feat: Add new hook
useInterval
#470 - ✨ Feat: Add new hook
useTitle
#490 - ✨ Feat: Add new hook
useWhyDidYouUpdate
#482 - 🐛 Fix: Change build target to ES5 #426
- 🐛 Fix: Remove
importHelpers
fromtsconfig.json
#486 - 🐛 Fix:
useVirtualList
remove extra padding at bottom #469 - 🐛 Fix: Change the behavior of
useRequest
notExecutedWarning from throw error toconsole.warn
#499
v2.1.0
v2.0.1
v2.0.0
从 umi hooks 升级为 ahooks
升级概览
- 新增了 3 个 Hooks
- 删除了 Umi Hooks 中废弃的 6 个 Hooks
- 制定了 API 规范,对 Hooks 进行了 API 升级
- 所有的 DOM 类 Hooks 不再返回 ref
- 部分 Hooks 不兼容升级
升级详情
新增
- 新增了 useFusionTable
- 新增了 useDebounceEffect
- 新增了 useThrottleEffect
删除
删除的 6 个 Hooks 可以用 useRequest 代替
- 删除了 useLoadMore
- 删除了 useAntdTable
- 删除了 useAPI
- 删除了 useAsync
- 删除了 usePagination
- 删除了 useSearch
其它
- useFormTable
- 重命名为 useAntdTable
- useRequest
- 内置请求库从
umi-request
变成了fetch
- 增加了
options.ready
配置,可以方便的实现依赖请求 - 增加了
options.throwOnError
配置 - Provider 从
UseAPIProvider
改名为UseRequestProvider
- 内置请求库从
- useDebounce
- 基于
lodash.debounce
实现,支持更多参数
- 基于
- useDebounceFn
- 基于
lodash.debounce
实现,支持更多参数 - 删除了
deps
参数
- 基于
- useThrottle
- 基于
lodash.throttle
实现,支持更多参数
- 基于
- useThrottleFn
- 基于
lodash.throttle
实现,支持更多参数 - 删除了
deps
参数
- 基于
- useBoolean
- API 升级
- useToggle
- API 升级
- useEventTarget
- API 升级
- useDocumentVisibility
- 如果 document 不存在,返回值从
true
变为undefined
- 如果 document 不存在,返回值从
- useSize
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useScroll
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useTextSelection
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useInViewport
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useFullscreen
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useEventListener
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useClickAway
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useHover
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
- useKeyPress
- API 升级,同时不再返回
ref
- API 升级,同时不再返回
Upgraded from umi hooks to ahooks
Upgrade overview
- Added 3 Hooks
- 6 abandoned Hooks in Umi Hooks were deleted
- Formulated API specification, upgraded the Hooks API
- All DOM class Hooks no longer return ref
- Some Hooks are incompatible with upgrades
Upgrade details
Add
- Added useFusionTable
- Added useDebounceEffect
- Added useThrottleEffect
Delete
The deleted 6 Hooks can be replaced by useRequest
- Deleted useLoadMore
- Deleted useAntdTable
- Deleted useAPI
- Deleted useAsync
- Deleted usePagination
- Deleted useSearch
Other
- useFormTable
- Rename to useAntdTable
- useRequest
- Built-in request Library from
umi-request
Becamefetch
- Added
options.ready
Configuration, can easily implement dependency requests - Added
options.throwOnError
Configuration, can easily implement dependency requests - Change the Provider name from
UseAPIProvider
toUseRequestProvider
- Built-in request Library from
- useDebounce
- Based on
lodash.debounce
Implementation, support more parameters
- Based on
- useDebounceFn
- Based on
lodash.debounce
Implementation, support more parameters - Deleted
deps
Parameter
- Based on
- useThrottle
- Based on
lodash.throttle
Implementation, support more parameters
- Based on
- useThrottleFn
- Based on
lodash.throttle
Implementation, support more parameters - Deleted
deps
Parameter
- Based on
- useBoolean
- API upgrade
- useToggle
- API upgrade
- useEventTarget
- API upgrade
- useDocumentVisibility
- If the document does not exist, the return value is from
true
Intoundefined
- If the document does not exist, the return value is from
- useSize
- API upgrade, and no longer return ref
- useScroll
- API upgrade, and no longer return ref
- useTextSelection
- API upgrade, and no longer return ref
- useInViewport
- API upgrade, and no longer return ref
- useFullscreen
- API upgrade, and no longer return ref
- useEventListener
- API upgrade, and no longer return ref
- useClickAway
- API upgrade, and no longer return ref
- useHover
- API upgrade, and no longer return ref
- useKeyPress
- API upgrade, and no longer return ref