I think I would break the loading out of res.response in useFetch().
Why? Because if you load something else (a different URL), then res.response already exists and won't cause the "loading..." to be shown... so the loading flag really needs to be before the start of fetch() and after setData()
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think I would break the
loading
out ofres.response
inuseFetch()
.Why? Because if you load something else (a different URL), then
res.response
already exists and won't cause the "loading..." to be shown... so the loading flag really needs to be before the start offetch()
and aftersetData()