Skip to content

Devtools are re-rerendering constantly on every cache update even when closed #4097

@pristas-peter

Description

@pristas-peter

Describe the bug

We are encountering performance issues with the app when using devtools with many queries (around 1000). We are using normalised cache keys, when for example fetch of list items updates data in each single fetch query via setQueryData.

However in v4, by using useSyncExternalStore things got really slow (app freezes for a short time when doing updates).

Is it possible to update devtools by batches, or is it even necessary to "observe" every query when the devtools are closed?

Your minimal, reproducible example

Steps to reproduce

Expected behavior

How often does this bug happen?

No response

Screenshots or Videos

No response

Platform

react-query version

v4 3.2.1

TypeScript version

4.7.4

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions