Skip to content
Source
Sign inSign up
TanStack/query

refactor(query-core)!: make notifyOnChangeProps static #12689

MergedTkDodomerged 3 commits intoquery-v6 fromrefs/pull/12689/headmerged by TkDodo View on GitHub

Showing 16 changed files with 17 additions and 4 deletions (loading 13).

x
0 of 16 viewed, 16 left
15 additions and 0 deletions.changeset/static-notification-modes.mdAdded
View file
@@ -0,0 +1,15 @@
+---
+'@tanstack/query-core': major
+'@tanstack/react-query': major
+'@tanstack/preact-query': major
+'@tanstack/solid-query': major
+'@tanstack/svelte-query': major
+'@tanstack/vue-query': major
+'@tanstack/lit-query': major
+---
+​
+Limit `notifyOnChangeProps` to the static values `'all'` and `'none'`.
+​
+Replace `[]` with `'none'` to suppress observer notifications while the query stays subscribed and can fetch. Error changes still notify the observer when `throwOnError` is set. Keep `'all'` to receive every result change.
+​
+For non-empty lists or callbacks, omit the option to use the adapter's default or choose a static value. In React Native, use `subscribed: isFocused` if the screen can unsubscribe when it loses focus.
1 addition and 2 deletionsdocs/eslint/no-rest-destructuring.mdModified
View file
@@ -38,8 +38,7 @@
​
## When Not To Use It
​
-If you set the `notifyOnChangeProps` options manually, you can disable this rule.
-Since you are not using tracked queries, you are responsible for specifying which props should trigger a re-render.
+You can disable this rule for queries that set `notifyOnChangeProps` to `'all'` or `'none'`. These modes skip property tracking.
​
## Attributes
​