slorber / react-async-hook

React hook to handle any async operation in React components, and prevent race conditions
https://sebastienlorber.com/handling-api-request-race-conditions-in-react
1.19k stars 45 forks source link

Throw error if dependency array is undefined #78

Open hypeJunction opened 2 years ago

hypeJunction commented 2 years ago

We just managed to DDOS our entire site, because we were missing an empty dependency array in the useAsync(), which resulted in endless refresh loop with microseconds between refreshes. I think it would be appropriate to throw an error if the value for denendecies in undefined

pig800509 commented 1 year ago

see my another answer