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

Where/when to fetch data? #80

Closed
ericflo opened this issue Jul 11, 2014 · 3 comments
Closed

Where/when to fetch data? #80

ericflo opened this issue Jul 11, 2014 · 3 comments

Comments

@ericflo
Copy link

ericflo commented Jul 11, 2014

In issue #38 it was suggested to discuss data fetching in another issue. I'll start:

Right now I've written my components such that the top-level components fetch data in a componentDidMount method. This is straighforward and works well for now, however, it won't work for server rendering, which the project I'm working on is going to need soon.

After already getting set up with react-nested-router, I came across RRouter, which has a fairly sane approach to this: http://andreypopp.github.io/rrouter/data-fetching.html It seems to me that this same approach could be applied to react-nested-router.

Thoughts?

@ryanflorence
Copy link
Member

It's a good approach. I'd rather have the function on a static method of the handler, feels better to me than pulling in many fetch functions in the route config.

We will absolutely support this use case in one form or another soon.

Sent from my iPhone

On Jul 10, 2014, at 6:48 PM, Eric Florenzano notifications@github.com wrote:

In issue #38 it was suggested to discuss data fetching in another issue. I'll start:

Right now I've written my components such that the top-level components fetch data in a componentDidMount method. This is straighforward and works well for now, however, it won't work for server rendering, which the project I'm working on is going to need soon.

After already getting set up with react-nested-router, I came across RRouter, which has a fairly sane approach to this: http://andreypopp.github.io/rrouter/data-fetching.html It seems to me that this same approach could be applied to react-nested-router.

Thoughts?


Reply to this email directly or view it on GitHub.

@mjackson
Copy link
Member

@ericflo We're discussing server-side rendering on #57. It's definitely a use case we will support.

@mjackson
Copy link
Member

Let's continue this discussion in #57.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants