Using trpcState with Remix
Following the guide, seems like the serialized stuff is sent down, but not used by the client.
6 Replies
Was able to get it to work by following teh react query docs for remix prefetching
^ if anyone else finds it useful
@jepcd Were you able to find a solution?
yeah, I followed the react query docs here: https://tanstack.com/query/v4/docs/framework/react/guides/ssr#using-hydration-1
SSR | TanStack Query React Docs
React Query supports two ways of prefetching data on the server and passing that to the queryClient. Prefetch the data yourself and pass it in as initialData Quick to set up for simple cases Has some...
Right, but the
QueryClient
is not typed. Were you able to use tRPC's syntax by any chance for the prefetching?
Also they seem to use Hydrate
which does not exist anymore in v11just had a look through the project and this is how I got it working
app/root.tsx
app/routes/dashboard/index.tsx
i also used v11 so it should work
@sh03
HydrationBoundary
is from react queryI see. This is awesome. Thank you very much 🙏 I owe you one