-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use renderToStaticMarkup
in when running build.
#121
Comments
How is it better than |
I guess load time for end users would be a factor for a large number of complex components. Also so bots can crawl. I guess for the same reasons as you'd want to pre-render on the server. |
I don’t ;-) But feel free to submit a pull request if it’s not very complicated to implement. |
@marklundin in React 15, the HTML should be more lightweight. Do you use it? And I think that long load time is caused mostly by #86. (If the page opens significantly faster in FF, then it's this one) |
@mik01aj good point, I'll take a look. I'm not sure if theres any real SEO impact thought. React does state you'd use |
I'm very interested to have a static rendering, because I'm making a styleguide for an application which is not in React. It would be very cool to have a static output which can be copied/pasted, without the React clutter. How would be the best way to do that? |
I'm also interested in this and might give it a try. |
@okonet Awesome! Unfortunately I have no experience with static rendering. |
Only some bots execute js (google spider does for example), but most of them don't wait for ajax calls to finish. I say most because I don't know any of them that do wait. Static rendering is the MUST for SEO optimization if you fetch data from a server using ajax and dynamically generate HTML afterward. Otherwise, it can improve the first-time-loading experience and allow your page to be cached more efficiently. In any case, it is nice to have such capability. |
Not sure how feasible this is, but could the style guide be statically rendered into the index.html using
ReactDOMServer
when compiled with the build option? Then rendered again viaReactDOM
to hook up the events.This could be useful to have static output.
The text was updated successfully, but these errors were encountered: