Use `renderToStaticMarkup` in when running build.
See original GitHub issueNot 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:
- Created 7 years ago
- Comments:10 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.I’m also interested in this and might give it a try.