♡ LoV432
♡ LoV432
Explore posts from servers
SSolidJS
Created by ♡ LoV432 on 4/18/2024 in #support
SolidStart with TanStack Query causing hydration error
Fixed! Turns out it was some npm bug maybe? The correct code was supposed to be
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnMount: false,
staleTime: Infinity,
},
},
});
export default function App() {
return (
<QueryClientProvider client={queryClient}>
<Messages />
</QueryClientProvider>
);
}
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnMount: false,
staleTime: Infinity,
},
},
});
export default function App() {
return (
<QueryClientProvider client={queryClient}>
<Messages />
</QueryClientProvider>
);
}
Instead of
export default function App() {
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnMount: false,
staleTime: Infinity,
},
},
});
return (
<QueryClientProvider client={queryClient}>
<Messages />
</QueryClientProvider>
);
}
export default function App() {
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnMount: false,
staleTime: Infinity,
},
},
});
return (
<QueryClientProvider client={queryClient}>
<Messages />
</QueryClientProvider>
);
}
which is how i was doing it originally but that was just straight up crashing my server, but after running npm update the issue was fixed 😅
2 replies