notdevkey
notdevkey
Explore posts from servers
TTCTheo's Typesafe Cult
Created by notdevkey on 9/7/2023 in #questions
Getting "drawer.css.map" when accessing getServerSideProps context
This is so dumb. I'm using Next.js 13, and a very simple getServerSideProps function, which should get the user id from the page route. The file is /pages/admin/[user].tsx, and I'm accessing the param using ctx.params.user, but even when the route is, for example, <host>/admin/id1234, the ctx.params.user value is "drawer.css.map". Any ideas why this is happening?
2 replies
TTCTheo's Typesafe Cult
Created by notdevkey on 8/25/2023 in #questions
How does React Query cache values?
I am working on a Plasmo browser extension that uses WebSockets to communicate with the API. I really need to cache previous responses because I need to keep a 'history' of all values and update them on an event. I know there's tutorials out there, even RQ docs have a blogpost about how to do this(https://tkdodo.eu/blog/using-web-sockets-with-react-query). But it just feels ambiguous to use queryClient.setQueryData() to kind of force RQ to use some data. And even if so, then the most correct way of retrieving data would be to use queryClient.getQueryData(["key"]) instead of something cleaner like useQuery(["key"])(it's requires queryFn). I want to know how RQ does the caching, so I could implement something simpler of my own without overhead for this specific case. Should I try a different caching solution or implement my own? Can I use RQ?
7 replies