Skip to content
Source
Sign inSign up
TanStack/query

fix(core): change `shouldFetchOptionally` condition #2556

Mergedjbee37142(GitHub profile, opens in a new tab)merged 3 commits intomaster fromrefs/pull/2556/headmerged by TkDodo View on GitHub

Related issue: https://github.com/tannerlinsley/react-query/issues/2187

Description

Change shouldFetchOptionally condition to not change the status of result to loading when state.status is error.

  1. result.isLoading is true in this line when result.error != null
  2. So the error did not propagate to the error boundary. (next condition)
  3. Check the createResult function and shouldFetchOptionally function

Fixes tannerlinsley/react-query#2187

Special thanks to @flybayer

    1. This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.

      🔍 Inspect: https://vercel.com/tannerlinsley/react-query/9aHMnSCooAbKNSo9bLf5zZ1EP9zM ✅ Preview: https://react-query-git-fork-jaeyeophan-fix-should-7780ae-tannerlinsley.vercel.app

    2. This pull request is automatically built and testable in CodeSandbox.

      To see build info of the built libraries, click here or the icon next to each commit SHA.

      Latest deployment of this branch, based on commit 9b0e0e49473ebf5e77f387a4798aa2204ee52b6a:

      SandboxSource
      tannerlinsley/react-query: basicConfiguration
      tannerlinsley/react-query: basic-typescriptConfiguration
    3. TkDodo reviewed

      OutdatedResolvedby TkDodo
    4. TkDodo approved these changes

    5. TkDodo merged this69f1eaf

    6. TkDodo closed this

    7. :tada: This PR is included in version 3.19.5 :tada:

      The release is available on:

      Your semantic-release bot :package::rocket:

    8. tannerlinsley added labelsreleased

Sign in to join this conversation.