Server-side data fetching with React streaming #2046
Unanswered
f0x52
asked this question in
Help & Questions
Replies: 1 comment
-
https://github.com/vikejs/vike-react/tree/main/packages/vike-react-query#usage-with-telefunc |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Looking at #1909 / vikejs/vike-react#148 +data hooks can't currently be used to do async work without blocking the whole page load.
The vike-react/full example uses
react-streaming/useAsync
, which works, but relies on an isomorphic function that works on the client as well in case the component re-mounts.I wonder if there's a decent workaround possible with a
useAsync
-like hook that uses different (async) functions for the client/server, where the server-side code for initial fetching can be tree-shaken out so it never gets sent to the client.Beta Was this translation helpful? Give feedback.
All reactions