simoneb / axios-hooks

🦆 React hooks for axios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'error' stays true in 'options change detection' example

rohan-rest-art opened this issue · comments

The examples block contains a link 'Options change detection':
https://codesandbox.io/s/axios-hooks-options-change-v23tl
I found an issue in this example.

How to reproduce:

  • Follow the link above.
  • Submit a request with user id '1'.
  • Shows data for user id '1'. Works good.
  • Submit a request with user id '2'.
  • Shows data for user id '2'. Works good.
  • Submit a request with user id '2222222222222222'.
  • Shows an error and data for user id '2'. Why hasn't 'data' changed? Looks weird but ok.
  • Submit a request with user id '1' again.
  • Shows an error and data for user id '1'. Why is 'error' still truthy?

Probably the issue has the same cause as #372

Thanks for reporting this. This looks like a bug in the cache. Would you like to submit a PR to fix it?

Its still a bug and a pretty annoying one. :/

This is now fixed, lmk if the new version works for you