Replies: 1 comment
-
Wrapping each data fetch in If you can't get away with hoisting your data fetching out of the component (though you should really try to, this is absolutely the best option by a huge margin), you can look at using suspense for your data fetching. I have a little example here that does this which may be useful. |
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
-
I am currently researching and try to do a server side rendered small site that need to fetch data from database server.
Rendering is entirely on server, and I am bit stuck because the only way to do data fetching must be moved in my controller, which is not bad but need to do some repeating job. Also I am not using framework, just fastify with renderToStringAsync().
I am bit stuck with that data fetching and the usage of Suspense and Lazy
Since I cannot do
I found a workaround with
My question is how reliable is this approach, is it OK to use in that way and is there better way?
Beta Was this translation helpful? Give feedback.
All reactions