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

SSR : how to render react component using ssr #637

Open
ansonla3 opened this issue May 29, 2016 · 6 comments
Open

SSR : how to render react component using ssr #637

ansonla3 opened this issue May 29, 2016 · 6 comments

Comments

@ansonla3
Copy link

I have installed the flow-router-ssr, but do not know to make the react component could do the server side rending.

What I have done is so far. is having a react component in the server folder then import it in the client side routes.jsx, then use the react-mounter to mount it, but there is nothing show on the screen.

anyone could help ? Please help,

@sahanDissanayake
Copy link

Have a look at these samples

https://github.com/kadira-samples/meteor-data-and-react

On May 30, 2016, 5:47 AM, at 5:47 AM, ansonla3 notifications@github.com wrote:

I have installed the flow-router-ssr, but do not know to make the react
component could do the server side rending.

What I have done is so far. is having a react component in the server
folder then import it in the client side routes.jsx, then use the
react-mounter to mount it, but there is nothing show on the screen.

anyone could help ? Please help,


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#637

@ansonla3
Copy link
Author

Yes, I read before,

this only in the container set the title, meta description. I want to render the whole react component in html format so that google could crawl the web page easily.

Do you have any ideas ? thanks very much .

@sahanDissanayake
Copy link

yep, the example link if gave you actually render the html on the server side. So google can crawl. Have you actually ran the code on your computer to see if it renders on the server or not ?

@ansonla3
Copy link
Author

ya , it works with that project.

but when use this project https://github.com/mantrajs/kickstart-mantrajs-webpack , remove the existing flow-router and install the flow-router-ss, it didn't work as expected. not sure what is the reason. Do you think that is related to webpack or mantrajs ? Can you help to have a try ?

Thanks very much.

@oychao
Copy link

oychao commented Oct 30, 2016

I have the same question, have you fixed that.

@lyquocnam
Copy link

lyquocnam commented Oct 30, 2016

have you import routes from meteor server code ? webpack do not load files auto.

ex:

// both/routes.js
...
FlowRouter.route('/', {
    action() {
      mount(Layout);
   }
}
// server.js
import 'both/routes';

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

4 participants