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
@@ -255,7 +255,6 @@ This library is being built and maintained by me, @tannerlinsley and I am always
255
255
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
256
256
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
257
257
258
-
259
258
-[Installation](#installation)
260
259
-[Defaults to keep in mind](#defaults-to-keep-in-mind)
261
260
-[Queries](#queries)
@@ -335,6 +334,7 @@ Out of the box, React Query is configured with **aggressive but sane** defaults.
335
334
- Query results that become unused (all instances of the query are unmounted) will still be cached in case they are used again for a default of 5 minutes before they are garbage collected. To change this, you can alter the default `cacheTime` for queries to something other than `1000 * 60 * 5` milliseconds.
336
335
- Stale queries will automatically be refetched in the background **when the browser window is refocused by the user**. You can disable this using the `refetchOnWindowFocus` option in queries or the global config.
337
336
- Queries that fail will silently and automatically be retried **3 times, with exponential backoff delay** before capturing and displaying an error to the UI. To change this, you can alter the default `retry` and `retryDelay` options for queries to something other than `3` and the default exponential backoff function.
337
+
- Query results by default are deep compared to detect if data has actually changed and if not, the data reference remains unchanged to better help with value stabilization with regards to useMemo and useCallback. The default deep compare function use here (`config.isDataEqual`) only supports comparing JSON-compatible primitives. If you are dealing with any non-json compatible values in your query responses OR are seeing performance issues with the deep compare function, you should probably disable it (`config.isDataEqual = () => false`) or customize it to better fit your needs.
- Defaults to the global query config's `useErrorBoundary` value, which is `false`
2219
2219
- Set this to true if you want mutation errors to be thrown in the render phase and propagate to the nearest error boundary
2220
2220
- `selectedUseQueryOptions`
2221
-
- *Selected* options of `useQuery` are also applicable here. E.g. `retry` and `retryDelay` can be used as described in the [`useQuery` section](#usequery). *Documentation of these options will be improved in the future.*
2221
+
- _Selected_ options of `useQuery` are also applicable here. E.g. `retry` and `retryDelay` can be used as described in the [`useQuery` section](#usequery). _Documentation of these options will be improved in the future._
2222
2222
2223
2223
### Returns
2224
2224
@@ -2550,6 +2550,7 @@ const queryConfig = {
2550
2550
refetchInterval:false,
2551
2551
queryFnParamsFilter:args=> filteredArgs,
2552
2552
refetchOnMount:true,
2553
+
isDataEqual: (previous, next) =>true, // or false
2553
2554
}
2554
2555
2555
2556
functionApp() {
@@ -2604,6 +2605,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
2604
2605
2605
2606
<!-- markdownlint-enable -->
2606
2607
<!-- prettier-ignore-end -->
2608
+
2607
2609
<!-- ALL-CONTRIBUTORS-LIST:END -->
2608
2610
2609
2611
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
0 commit comments