Skip to content

Dehydrate stale fetching queries? #8785

Answered by erjohnms
erjohnms asked this question in General
Discussion options

You must be logged in to vote

For those that come across this thread, I've been testing the below patch in our setup, and it's been working well. But keep in mind that the only place I dehydrate pending/fetching queries is when passing the query client in my Remix loaders to my routes. In other cases, such as persisting queries to Redis, I'm awaiting the promises before dehydrating. So, if you have other uses cases as TkDodo mention's above, YMMV.

diff --git a/build/modern/hydration.js b/build/modern/hydration.js
index 6c25c664ba5d7f0b1b5e6fb95067930543bfc140..5bff8badc113b4b82ed99ce7f694f9026b5ce575 100644
--- a/build/modern/hydration.js
+++ b/build/modern/hydration.js
@@ -20,7 +20,7 @@ function dehydrateQuery(query,…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by erjohnms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants