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
Then when the data finishes loading, it changes to:
{data: {…}, error: undefined, isLoading: false}
When the fetchye key (for instance the body of the request) changes, you would expect the state to change back to loading. But instead the first render is this:
This has special handling for render count == 1. But the render count is not reset when the key changes, so this logic is not used later, even though it's the same case as the first render.
🐞 Bug Report
Describe the bug
On the initial render of a component using fetchye, the returned values are:
Then when the data finishes loading, it changes to:
When the fetchye key (for instance the body of the request) changes, you would expect the state to change back to loading. But instead the first render is this:
This makes it difficult to write any code that is dependent on
isLoading
to render a loading indicator.To Reproduce
Example code:
Prints this to console:
Expected behavior
isLoading
should be true after the key changes.The text was updated successfully, but these errors were encountered: