Skip to content
Discussion options

You must be logged in to vote

you can pass an isDataEqual function to useQuery or provide it globally. There, you can do your own comparison :)

it's not very well documented, but mentioned here:
https://react-query.tanstack.com/guides/important-defaults

Structural sharing only works with JSON-compatible values, any other value types will always be considered as changed. If you are seeing performance issues because of large responses for example, you can disable this feature with the config.structuralSharing flag. If you are dealing with non-JSON compatible values in your query responses and still want to detect if data has changed or not, you can define a data compare function with config.isDataEqual.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jcready
Comment options

@TkDodo
Comment options

@jcready
Comment options

@TkDodo
Comment options

Answer selected by jcready
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants