hooks icon indicating copy to clipboard operation
hooks copied to clipboard

A high-quality & reliable React Hooks library.

Results 247 hooks issues
Sort by recently updated
recently updated
newest added

能否加一个请求之前的回调函数,这样可以在发起请求之前做一些逻辑

不废话..直接上代码... ```js // v2 const getApiDataAres = useRequest(getApiDataA, { initialData: DataAinit }) const getApiDataBres = useRequest(getApiDataB, { initialData: DataBinit }) const getApiDataCres = useRequest(getApiDataC, { initialData: DataCinit }) ``` ```js...

feature

[[English Template / 英文模板](https://github.com/alibaba/hooks/blob/master/.github/PULL_REQUEST_TEMPLATE.md)] ### 🤔 这个变动的性质是? - [ ] 新特性提交 - [x] 日常 bug 修复 - [ ] 站点、文档改进 - [ ] 演示代码改进 - [ ] TypeScript 定义更新 -...

[[中文版模板 / Chinese template](https://github.com/alibaba/hooks/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)] ### 🤔 This is a ... - [ ] New feature - [x] Bug fix - [ ] Site / documentation update - [ ] Demo...

[[中文版模板 / Chinese template](https://github.com/alibaba/hooks/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)] ### 🤔 This is a ... - [ ] New feature - [ ] Bug fix - [ ] Site / documentation update - [ ]...

使用 useVirtualList 按照官网的案例,滚动时列数据会剧烈滚动 ![DF79F30F-8618-4036-8D66-CAF110C8178D](https://user-images.githubusercontent.com/16314366/167578378-8a4a6859-d3ed-453d-b71d-74fd7ec156f8.png) https://user-images.githubusercontent.com/16314366/167578256-1321465b-cd34-40a1-a562-437e8b588d53.mp4

help wanted

[[中文版模板 / Chinese template](https://github.com/alibaba/hooks/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)] ### 🤔 This is a ... - [x] New feature - [ ] Bug fix - [ ] Site / documentation update - [ ] Demo...

假设有一个书籍列表页,点击书名就会进入到书籍的详情页。我想在列表页利用 `cacheKey` 做一个预加载,当鼠标移到具体书名的时候就发起请求,这样当用户真正点击进去发起请求时 cacheKey 与列表页请求的 cacheKey 相同。但以目前的方式想要实现我只能想到这样,是我错过了什么吗? ```ts // services const getBook = (id) => axios.get(`/book/${id}`).then((res) => res.data); const getBookList = () => axios.get("/books").then((res) => res.data); const Books = ()...

#1351 ### 基于上面的 issue,这里单独开一个 RFC issue 讨论一下: ### 目前大概实现了一下,返回值长这样: ![动画3](https://user-images.githubusercontent.com/49217418/181870801-86bd485f-2208-410c-90fc-380a781e5e60.gif) ### 需要讨论的是: #### 1. 不同于其它hook,这里所有方法都是异步的,需要在 .then 里面才能执行回调,所以需要讨论一下有没有实现的必要 ![QQ20220801-162735](https://user-images.githubusercontent.com/49217418/182106854-73ee5551-4907-4e93-8285-5dc2027ae5c9.png) #### 2. 因为实现了批量set、批量get、批量delete,所以入参key可能是数组,如果直接传在hook里面的话不是很好管理,最好的办法是传进具体的每一个方法里,但是这样就违背了hook的原则,想问一下你们有什么好的想法? @brickspert @crazylxr @hchlq @miracles1919