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

How to use router with server side rendering #477

Closed
optimatex opened this issue Nov 22, 2017 · 4 comments
Closed

How to use router with server side rendering #477

optimatex opened this issue Nov 22, 2017 · 4 comments

Comments

@optimatex
Copy link

As I know, isomorphic apps use the same routing as on a client. That's means server should always return index.html page and routes should be handled by react-router or something like this when are rendered on the server side. Otherwise, after the page is loaded any future route change will lead to page reload.
How can I implement this tenet in the approach described here since I need to pass the appropriate model to @Html.React? Should it be something like server side routing with the single concern to retrieve the corresponding model based on the current route?
thank you for your hard work

@Daniel15
Copy link
Member

The newly-added React.Router package should help you use React Router with server-side rendering. #476 tracks adding a sample project.

@optimatex
Copy link
Author

Thanks

@dustinsoftware
Copy link
Member

@optimatex I opened a PR here, hope it is helpful #479

@dustinsoftware
Copy link
Member

Closing because this question has been answered, please re-open if you'd like some more help 😄

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