question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use `renderToStaticMarkup` in when running build.

See original GitHub issue

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 via ReactDOM to hook up the events.

This could be useful to have static output.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
marklundincommented, Apr 12, 2016

@mik01aj good point, I’ll take a look. I’d still be interested to see how much better a static page loads though. As @sapegin said, if it’s a fairly straightforward update I’ll submit a PR.

I’m not sure if theres any real SEO impact thought. React does state you’d use renderToStatic for this very reason, but my understanding is that most bots execute js and wait for the page to load anyway, so this may be a non issue.

2reactions
okonetcommented, Feb 7, 2017

I’m also interested in this and might give it a try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Is there a way to accomplish `renderToStaticMarkup ...
We are currently using ReactDOM.renderToStaticMarkup ...
Read more >
ReactDOMServer – React
On the server, it is recommended to use either renderToPipeableStream (for Node.js) or renderToReadableStream (for Web Streams) instead. renderToStaticMarkup().
Read more >
Creating a static website with ReactJS and ... - Codemzy's Blog
It's quick and easy, and you won't even need to configure Webpack to do it! Use renderToStaticMarkup(). Static websites are safe, speedy and ......
Read more >
Improving Server-Side Rendering with React
tldr: if you're using react-dom/server to render a large number of static ... As I was translating EJS to JSX, I was running...
Read more >
How to use the react-dom/server.renderToStaticMarkup ... - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found