简体   繁体   English

反应渲染的静态 Html 文件 - 服务器端渲染?

[英]Static Html file of a react render - server side rendering?

For future processing I want my server to render my React to static HTML and publish the HTML files into directory on my server.为了将来的处理,我希望我的服务器将我的 React 呈现为静态 HTML,并将 HTML 文件发布到我服务器上的目录中。

How I do this?我怎么做? I looked at server side rendering such as https://www.npmjs.com/package/react-snapshot but I am not sure exactly if it will create a file I will be able to see - when I looked at the instructions it didn't seem to request a path for the file so I don't think I will be able to see the render file.我查看了服务器端渲染,例如https://www.npmjs.com/package/react-snapshot但我不确定它是否会创建一个我能够看到的文件 - 当我查看说明时它没有'似乎没有请求文件的路径,所以我认为我看不到渲染文件。

I hate to give such a vague and generic answer, but really your question (or lack thereof) is vague also, so ....我讨厌给出如此模糊和笼统的答案,但实际上您的问题(或缺乏问题)也很模糊,所以......

In short, there are many ways to convert HTML to Mobi, and this article outlines several of them: https://www.epubor.com/convert-html-to-mobi.html总之,HTML 转 Mobi 的方法有很多,本文概述了其中的几种: https : //www.epubor.com/convert-html-to-mobi.html

If you're issue is more "how do I get HTML from JSX", you'll want to look into "server-side React rendering".如果您的问题更多是“我如何从 JSX 获取 HTML”,那么您将需要研究“服务器端 React 渲染”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM