-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isLoading only works on the first fetch (solution in comments) #193
Comments
You can use Does this help? Or otherwise I might misunderstand you. |
The problem with fetch is that it happens every single time you load data. For example, if have a list, I might want to show a loadbar or skeleton the first time it loads. But then when it gets updated, I don't need to hide what I loaded. But sometimes the first load is an empty array, in which case isLoading should be true again. But either way the way it is coded now is wrong.
|
What I mean is this line will never cause it to be true |
In other words, if you don't agree with my use case, you should get rid of this line |
Ah, thanks for clarifying, I see now what you mean. |
Fixed in #200 |
Released in 1.3.1 |
New Bug Report
Checklist
Issue Description
Steps + code to reproduce
Actual Outcome
isLoading only can be true on first fetch.
Expected Outcome
isLoading should be true on every fetch where the data is empty...including empty array
Someone else posted this in Novemeber, and I ran into the issue myself:
https://forum.moralis.io/t/bug-in-isloading-when-using-usemoraliscloudfunction-in-react/4453
I HAVE PLACED A SOLUTION IN MY THREAD!
https://forum.moralis.io/t/isloading-is-always-false-on-usemoralisquery/9549
The isLoading state conditional statement needs to allow the empty array possibility, where as now it only can be true if data is null.
I didn't have time to test enough to put in a pull request.
The text was updated successfully, but these errors were encountered: