Data loading solutions?
overlookmotel opened this issue · 3 comments
I've just published react-lazy-data, a package to handle async data fetching which works well with react-async-ssr
.
However, I'd be really interested to hear from anyone who has found any other solution for this.
I suspect that other data loading packages (e.g. apollo, react-query) may work with react-async-ssr
already, or could be quite easily modified to do so.
Please let me know if I'm right!
@revskill10 You mentioned in #2 (comment) a while ago that you had this working with apollo. Can you share some details please?
Hi @overlookmotel,
I find this lib very useful, and I use it in prod.
here's an example project of the approach I'm using.
I would be happy to get your feedback...
defining the closure which aggregate resources in the server
providing the closure in ssr(using renderToStringAsync)
passing the serialized resources through the template
loading the resources on hydration
and finally:
consuming in a function component