Closed nikhilverma360 closed 3 months ago
[!IMPORTANT]
Review skipped
Auto reviews are limited to specific labels.
Labels to auto review (1)
* dependenciesPlease check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Yes, I agree to the point that isFetching
will be true while refetching.
After digging down I got to know that we are using @tanstack/react-query
V4 while in wagmi v2 docs it was referring to V5
in v4 isLoading= isPending
. while in V5 isLoading = isPending&&isFetching
I think in our case we need isPending&&isFetching
or isLoading
of V5😅
so eg, in our case if we are using dependent Query,
if we go for isPending
🧐.
const { data: addressFromENS, isLoading } = useEnsAddress({
query: {
// if alias.address is not an Address, we treat it as ENS and try to fetch address from there
enabled: !isAddress(alias.address),
},
name: alias.address,
chainId: 1,
});
if query.enabled === false
then it will continue to show pending even we don't want to fetch anything and hence loading skeleton will appear in frontend :
status: 'pending'
isPending: true
fetchStatus: 'idle'
isFetching: false
isPending&&isFetching: false
once if query.enabled === true
then :
status: 'pending'
isPending: true
fetchStatus: 'fetching'
isFetching: true
isPending&&isFetching: true
at last once data is fetched and query.enabled === true
then :
status: 'success'
isPending: false
fetchStatus: 'idle'
isFetching: false
isPending&&isFetching: false
so IMO, If we are using v4 then we should implement isPending&&isFetching
or if we gonna use v5 then we should close this PR, v5 fix all the issue.
WDYT🤔
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
No data about Duplication
This PR solves : https://github.com/kleros/kleros-v2/pull/1417#issuecomment-2141333133
PR-Codex overview
This PR updates
@tanstack/react-query
from version 4.28.0 to 5.40.1, along with related dependencies.Detailed summary
@tanstack/react-query
to version 5.40.1@tanstack/query-core
version 5.40.0react
to ^18.0.0