You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First type in the input text: fafafa, or any non-pokemon text.
The text: Error searching fafafa: fafafa not found will appear.
Next, enter in the input text: ditto.
Since we add 10-second delay to the url to search for ditto, the request will take 10 seconds to finish. So I expect the text Searching ditto will appear, but instead the text: Error searching ditto: dfadfa not found appears. It seems useSWR returns the error from the previous key, fafafa.
After 10 seconds, the error text disappears as expected and the response is displayed.
Since the key changes, useSWR should not return error from previous request imo.
Additional Context
SWR version: 0.3.9
The text was updated successfully, but these errors were encountered:
Bug report
Description / Observed Behavior
What kind of issues did you encounter with SWR?
When a request takes long to load,
useSWR
returns the error from the previous request, even though the keys are different.Expected Behavior
How did you expect SWR to behave here?
useSWR
should not return error from a different key.Repro Steps / Code Example
https://pokeapi.co/api/v2/pokemon/ditto
with10000
ms delay. Toggle on theEnabled
switch.fafafa
, or any non-pokemon text.Error searching fafafa: fafafa not found
will appear.ditto
.ditto
, the request will take 10 seconds to finish. So I expect the textSearching ditto
will appear, but instead the text:Error searching ditto: dfadfa not found
appears. It seemsuseSWR
returns the error from the previous key,fafafa
.Since the key changes,
useSWR
should not return error from previous request imo.Additional Context
SWR version: 0.3.9
The text was updated successfully, but these errors were encountered: