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
Copy file name to clipboardExpand all lines: packages/query-core/src/utils.ts
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -356,15 +356,13 @@ export function replaceData<
356
356
}elseif(options.structuralSharing!==false){
357
357
if(process.env.NODE_ENV!=='production'){
358
358
try{
359
-
JSON.stringify(prevData)
360
-
JSON.stringify(data)
359
+
returnreplaceEqualDeep(prevData,data)
361
360
}catch(error){
362
361
console.error(
363
-
`StructuralSharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,
362
+
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,
364
363
)
365
364
}
366
365
}
367
-
368
366
// Structurally share data between prev and new data if needed
0 commit comments