Skip to content

placeholderData not applied when query is disabled #1749

@timtnleeProject

Description

@timtnleeProject

Describe the bug
When there're query dependent, the last query:

  1. placeholderData not applied until the query is fetching.
  2. isLoading never triggerd.

To Reproduce
online sandbox:
https://codesandbox.io/s/react-query-issue-et8hs?file=/src/index.js

I have two querys: auth, getUserDetail.
getUserDetail depends on auth.

The fetching order will be: auth -> getUserDetail.

placeholderData of getUserDetail is set to "placeholder"

  1. when auth is fetching, the placeholderData of getUserDetail is undefined (BUG ?).
  2. when getUserDetail is fetching, the placeholderData of getUserDetail is "placeholder" .
  3. isLoading of getUserDetail is never been true (BUG ? I want to make sure this is expect behavior.).

Expected behavior

  1. placeholderData applied at start (isIdle).

Desktop (please complete the following information):

  • Device: [PC]
  • OS: [Win10]
  • Browser: [edge(chromium)]

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions