Skip to content

errors are cached and not reset if the component using useQuery is remounted #468

@aaronjensen

Description

@aaronjensen

Here's an example: https://codesandbox.io/s/elegant-minsky-wwfko?file=/src/index.js

Close the error report window then click "retry". That will remount the Posts component but it will error immediately.

If you uncomment the queryCache.clear() it works.

I would expect that errors are not cached, or that they're cleared when the component is remounted.

My guess is that since the component never officially mounts, there's some edge case here that isn't accounted for, or that this is an intractable problem and I should just always clear the cache on an error (which may very well be a good idea anyway).

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