use-http
use-http copied to clipboard
useFetch error value is buggy/stale/broken
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).
Thanks for reporting! Will take a look asap
Seems to still be a problem.