hooks icon indicating copy to clipboard operation
hooks copied to clipboard

useRequest: loading延迟和缓存新鲜度混合使用会出问题

Open 1075488066 opened this issue 1 year ago • 1 comments

新鲜时退出请求操作后,loading延时又把loading设置成了true,然后就变成了一直loading状态了。

https://codesandbox.io/s/floral-hill-cdvn7x?file=/App.tsx

1075488066 avatar Aug 24 '23 14:08 1075488066

看了下确实是个BUG。在staleTime时间内,没有发起新的请求,也就不会调用各个插件的onFinally,所以loading的定时器依然存在,然后loading在固定时间后被设置为了true。

candy4290 avatar Aug 25 '23 09:08 candy4290