Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data loading solutions? #66

Open
overlookmotel opened this issue Apr 6, 2020 · 3 comments
Open

Data loading solutions? #66

overlookmotel opened this issue Apr 6, 2020 · 3 comments

Comments

@overlookmotel
Copy link
Owner

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!

@overlookmotel
Copy link
Owner Author

@revskill10 You mentioned in #2 (comment) a while ago that you had this working with apollo. Can you share some details please?

@selama
Copy link

selama commented Jul 27, 2020

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...

common utilities

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

@codler
Copy link

codler commented Sep 30, 2020

@selama awesome! thanks for sharing! it was just what I was looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants