Skip to content

Commit

Permalink
fix(solid-query): Fix query refetch after SSR (#7127)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardeora committed Mar 16, 2024
1 parent a6da187 commit f2e7af8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/solid-query/src/createBaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,17 @@ export function createBaseQuery<
),
)

createComputed(() => {
if (!isRestoring() && !isServer) {
refetch()
}
})
createComputed(
on(
isRestoring,
(restoring) => {
if (!restoring && !isServer) {
refetch()
}
},
{ defer: true },
),
)

onCleanup(() => {
if (isServer && queryResource.loading) {
Expand Down

0 comments on commit f2e7af8

Please sign in to comment.