Skip to content

Commit 0fbe732

Browse files
committed
feat(useQuery): run placeholderData through select
fix structural sharing, in the options, we might also have the placeholderData function, but on the previous result, we have the correct result from the previous iteration, which we want to keep if possible
1 parent 9560eff commit 0fbe732

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/queryObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ export class QueryObserver<
514514
placeholderData = options.select(placeholderData)
515515
if (options.structuralSharing !== false) {
516516
placeholderData = replaceEqualDeep(
517-
prevResultOptions?.placeholderData,
517+
prevResult?.data,
518518
placeholderData
519519
)
520520
}

0 commit comments

Comments
 (0)