React SSR in Action
React SSR in Action
react render HTML string from the server
ReactDOMServer
https://reactjs.org/docs/react-dom-server.html
// ES modules
import ReactDOMServer from 'react-dom/server';
// CommonJS
var ReactDOMServer = require('react-dom/server');
renderToString & renderToStaticMarkup
ReactDOMServer.renderToString(element)
ReactDOMServer.renderToStaticMarkup(element)
renderToNodeStream & renderToStaticNodeStream
Node.js Readable Streams
https://nodejs.org/api/stream.html#stream_readable_streams
ReactDOMServer.renderToNodeStream(element)
ReactDOMServer.renderToStaticNodeStream(element)
ReactDOM
https://www.w3schools.com/react/react_render.asp
https://github.com/wrakky/react-html-parser
https://reactjs.org/docs/dom-elements.html
https://stackoverflow.com/questions/19266197/reactjs-convert-html-string-to-jsx
Next.js
Nest.js
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/12348056.html
未经授权禁止转载,违者必究!