Comments (7)
@proddy I will see it tomorrow. now I have to go to sleep.🥱
from alova.
@proddy Now the bug is fixed. the reason is react strict mode will emit useEffect
twice and the second time is going to send a request
from alova.
Hi proddy! thanks for supporting alova.
If it's the same as what you describe, I think it should be a bug. but this case is already passed unit test, see here(second test)
so, you can provide a demo which can reproduce the bug, I will resolve it as soon as possible.
from alova.
Hey, thanks for the quick response. I cooked up a really small sandbox app here . When you run it, and monitor the traffic using the browser dev tools->Network you'll see it'll always make the Request even if the immediate
flag is false. Hope it helps!
from alova.
🎉 This issue has been resolved in version 2.5.5 🎉
The release is available on:
Your semantic-release bot 📦🚀
from alova.
@proddy Now the bug is fixed. the reason is react strict mode will emit
useEffect
twice and the second time is going to send a request
Thanks for the quick fix, much appreciated. I was thinking last night too it may be related to the Strict mode so good catch. I'm really loving this library.
from alova.
😁😁😁
Another small secret is that alova's shared request can prevent sending request twice during initialization in react strict mode
from alova.
Related Issues (20)
- [Bug]: `alova/client`类型文件指向错误 HOT 1
- [Bug]: 在小程序环境中使用 useAutoRequest 报错 Cannot read property 'addEventListener' of undefined
- [Bug]: useHooks的`update`类型错误 HOT 1
- [Bug]: `usePagination`的debounce失效 HOT 1
- [Bug]: mock数据在返回`null`时报错
- [Bug]: `usePagination`的`pageCount`没有自动计算,导致一直为0 HOT 2
- [Optimized item]: 使用`useSQRequest`报错时,`[alova/useSQHook]`前缀优化
- [Bug]: Uniapp的 localCache mode='placeholder' 无法正确运行 HOT 7
- [Bug]: 在`createAlovaMockAdapter`中的`onMockResponse`抛出错误,控制台还会提示请求成功
- [Bug]: 在`useSQRequest`的`middleware`中调用`next`无法获得响应数据
- [Bug]: `useSQRequest.onBeforePushQueue`设置为异步回调时无法获取返回数据 HOT 1
- [Bug]: `useForm`在多步骤表单中`loading`不变且`onSuccess`多次触发
- [Bug]: Uniapp的适配器与tokenAuthentication所导出两个方法会产生类型报错
- [Bug]: 基于服务端Token认证,refreshTokenOnSuccess的handler中,调用最近请求接口无响应 HOT 4
- [Bug]: usePagination对加载异常的页数会认为加载成功了 HOT 10
- [Bug]: 在 `Uniapp` 环境中,`useFetcher` 的 `force` 属性无效,依旧击中缓冲数据 HOT 2
- [Bug]: `useRequest` 返回的 data 得到的默认类型推断不正确 HOT 1
- [Bug]: `@alova/psc`无法在多个进程**享内存 HOT 1
- [Bug]: Response Headers 不存在 HOT 3
- [Bug]: `rate-limit`组件重置的倒计时未减少 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alova.