You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs(query-keys): clarify query key refetching
Update the query-key documentation to note that changing data included in a query key will automatically refetch the query data.
It took me a long time to find this information, and I expected to find it here. I consulted with another engineer on our team, and they agreed that they would expect to see it stated more clearly here. So we felt this addition would be helpful.
* Update docs/react/guides/query-keys.md
* Update docs/react/guides/query-keys.md
---------
Co-authored-by: Dominik Dorfmeister <[email protected]>
Copy file name to clipboardExpand all lines: docs/react/guides/query-keys.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,8 @@ function Todos({ todoId }) {
90
90
```
91
91
92
92
[//]: #'Example5'
93
+
94
+
Note that query keys act as dependencies for your query functions. Adding dependent variables to your query key will ensure that queries are cached independently, and that any time a variable changes, *queries will be refetched automatically (depending on your `staleTime` settings).* (See the [exhaustive-deps](../eslint/exhaustive-deps) section for more information and examples.)
0 commit comments