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
This may be related to #24. Whenever I change the dependencies, I get three rerenders where I only expect to see two.
Expected:
Change dependencies.
Render with isLoading === true, data === null
Render with isLoading === false, data === <new-result>
Actual:
Change dependencies.
Render with isLoading === false, data === <previous-result>
Render with isLoading === true, data === <previous-result>
Render with isLoading === false, data === <new-result>
I don't care so much about data containing the previous result, and changing just that to null with no additional changes would be bad. But why am I getting that first rerender which is a copy of the previous call result? I would expect calling the hook with changed dependencies to immediately return with isLoading === true.
To be clear, everything works okay. The downside is the additional no-op render due to the first result being identical to the previous result. I assume the fetch call has been made by that point, and yet the hook tells me it's not loading. Is there any way to avoid that (step 2 above)?
The text was updated successfully, but these errors were encountered:
This may be related to #24. Whenever I change the dependencies, I get three rerenders where I only expect to see two.
Expected:
isLoading === true, data === null
isLoading === false, data === <new-result>
Actual:
isLoading === false, data === <previous-result>
isLoading === true, data === <previous-result>
isLoading === false, data === <new-result>
I don't care so much about
data
containing the previous result, and changing just that tonull
with no additional changes would be bad. But why am I getting that first rerender which is a copy of the previous call result? I would expect calling the hook with changed dependencies to immediately return withisLoading === true
.To be clear, everything works okay. The downside is the additional no-op render due to the first result being identical to the previous result. I assume the fetch call has been made by that point, and yet the hook tells me it's not loading. Is there any way to avoid that (step 2 above)?
The text was updated successfully, but these errors were encountered: