refine icon indicating copy to clipboard operation
refine copied to clipboard

[BUG] setShowId is not triggering queryResult: isLoading, isError on useShow

Open beg1c opened this issue 1 year ago • 1 comments

Describe the bug

When trying to change viewing record with setShowId, isLoading and isError are not triggered.

Steps To Reproduce

const { queryResult, setShowId } = useShow();
const { isLoading } = queryResult;

if (isLoading) {
    return (
        <Loader />
    )
}

After calling

setShowId(3)

nothing happens until resource is fetched succesfully. If request is bad, isError isn't triggered either.

Expected behavior

To be able to use isLoading to show loading screen or isError to catch error.

Packages

  • @refinedev/core

Additional Context

No response

beg1c avatar Mar 26 '24 17:03 beg1c

Hey @beg1c

isLoading is false initially, before the query mounts. And then it becomes true when query is mounted (Not necessarily fetch. It might be disabled.). Once isLoading is true, it never goes back to false. Unlike isFetching.

For isErrror, could you provide a minimal reproducible example?

BatuhanW avatar Mar 29 '24 06:03 BatuhanW

Closing this for now, feel free to re-open when you can provide a minimal reproducible example about the isError property.

aliemir avatar Apr 17 '24 08:04 aliemir