云泥
云泥
I tested the useUrlState hook in a demo project, but was unable to reproduce your situation: https://github.com/alibaba/hooks/assets/38221479/4d005ea0-60c7-43fb-9064-2610131f4e7a Both hash router and browser router were tested. So can your confirm this...
 看截图这个目录结构和文件名,感觉不像是 v3 的 ahooks,像是 v2 版本的。应该是用的这个包:https://www.npmjs.com/package/@ahooksjs/use-request
楼主用了 v2 的这个用法: https://ahooks-v2.js.org/zh-CN/hooks/async#%E9%9B%86%E6%88%90%E8%AF%B7%E6%B1%82%E5%BA%93  然后他的 service 传函数时,返回值出现了 undefined,导致:`s.then` 取值报错: @chenJJ-88 你应该调整 service 函数的返回值,不能返回假值(null, undefined)
另外 v2 已经不再维护,可以的话请升级最新版本
相关 issue:https://github.com/alibaba/hooks/issues/2266 #2266 对应的 PR 会有 breaking changes。建议废弃掉 useGetState,引入这个 hook mark 一下
相关 issue/PR - https://github.com/alibaba/hooks/issues/2114 - https://github.com/alibaba/hooks/issues/2227 - https://github.com/alibaba/hooks/issues/1302 - https://github.com/alibaba/hooks/pull/1303 `useSize` 存在的问题在上述 issue/PR 的评论区,包含的问题有:“获取精度问题、DOM 尺寸计算规范问题 和 scale 下的尺寸问题” 这个 PR 肯定是 breaking changes 的,先留着,v4 会统一处理哈~
可以考虑加个重试次数的回调
https://github.com/lodash/lodash/blob/main/src/debounce.ts#L77-L78  @crazylxr 见哥,这里 wait 设置 0 恰好是绕过 requestAnimationFrame,需要 ahooks 支持用户设置 wait 为 undefined 来启用 requestAnimationFrame 的,你再看下呢~
solved: https://github.com/alibaba/hooks/pull/2332
It's a bug, thank you for your feedback.