@tanstack/react-query 4.1.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/query-core/build/esm/index.js +2 -0
- package/build/cjs/query-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats.json +180 -180
- package/build/types/packages/query-core/src/types.d.ts +10 -8
- package/build/types/packages/react-query/src/types.d.ts +3 -4
- package/build/umd/index.development.js +2 -0
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/types.ts +10 -4
|
@@ -355,6 +355,8 @@ function replaceData(prevData, data, options) {
|
|
|
355
355
|
// Use prev data if an isDataEqual function is defined and returns `true`
|
|
356
356
|
if (options.isDataEqual != null && options.isDataEqual(prevData, data)) {
|
|
357
357
|
return prevData;
|
|
358
|
+
} else if (typeof options.structuralSharing === 'function') {
|
|
359
|
+
return options.structuralSharing(prevData, data);
|
|
358
360
|
} else if (options.structuralSharing !== false) {
|
|
359
361
|
// Structurally share data between prev and new data if needed
|
|
360
362
|
return replaceEqualDeep(prevData, data);
|