use-http icon indicating copy to clipboard operation
use-http copied to clipboard

useFetch error value is buggy/stale/broken

Open ultd opened this issue 4 years ago • 2 comments

Describe the bug Destructuring the error property from useFetch causes stale error value even after retrying (and succeeding) the original request. The error value is behind and or doesn't get updated properly.

⚠️ Make a Codesandbox ⚠️ https://codesandbox.io/s/priceless-torvalds-v0e8y?file=/src/App.tsx:349-354

Just click Do Some Action button a few times to observe the buggy behavior.

To Reproduce See codesandbox above

Expected behavior I expect error property to not be stale and to represent the error of the most recent request (if there is one).

ultd avatar Jan 17 '21 17:01 ultd

Thanks for reporting! Will take a look asap

iamthesiz avatar Jan 18 '21 17:01 iamthesiz

Seems to still be a problem.

jakajancar avatar Jun 20 '21 21:06 jakajancar