Serialize dates with SSR / react-query
Is there a nice/automatic way to serialize/deserialize dates in react-query when doing SSR hydration? (I'm using next.js).
useQuery
doesn't seem to have a deserialize fn - so whatever gets put in there will be wrong.
react-query in general doesn't seem well designed / thoughtful for SSR. Am I missing something?2 Replies
absent-sapphire•2y ago
superjson can do it
sunny-greenOP•2y ago
I don't think this helps - I'm asking how I can avoid a manual deserialize step on the client side in every component that needs the data when using ssr data from react-query