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

Recursive Data Fetching #4

Closed
jaredpalmer opened this issue Dec 5, 2017 · 7 comments
Closed

Recursive Data Fetching #4

jaredpalmer opened this issue Dec 5, 2017 · 7 comments

Comments

@jaredpalmer
Copy link
Owner

jaredpalmer commented Dec 5, 2017

We would need to walk the tree 🚶‍♀️

@jaredpalmer jaredpalmer changed the title Recursive Data Recursive Data Fetching Dec 5, 2017
@mjackson
Copy link
Collaborator

You basically just need to figure out which components you're planning to render, go fetch all their props, and then provide them to the components, right? I already did this back in earlier versions of RR. Would be happy to take a stab at it again here :D

@jaredpalmer
Copy link
Owner Author

Yeah the would be awesome.

@jaredpalmer
Copy link
Owner Author

On this note, have a gut feeling that the solution could be very useful if we wanted do a static export like gatsby (but obviously without the graphql complexity)

@mohsen1
Copy link
Contributor

mohsen1 commented Jan 15, 2018

You basically just need to figure out which components you're planning to render

Rendering once to figure out what data needs to be fetched is something I did before. Not clean but it works. Only if React render could return a promise... 😬

@tamagokun
Copy link

I've used this in the past to accomplish data fetching for any component in a tree on the server: https://github.com/ctrlplusb/react-tree-walker

Worked out really well.

@jaredpalmer
Copy link
Owner Author

Yeah that could work.

@mjackson is react-router-config matchRoutes recursive? Should we be using that instead of the current implementation?

@benkingcode
Copy link

@jaredpalmer I actually just implemented this in a project I'm working on, I've published it as an npm package, might be of help!

https://github.com/dbbk/react-data-fetching-components

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

5 participants