xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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

https://stackoverflow.com/questions/39758136/render-html-string-as-real-html-in-a-react-component/55884366

Next.js

https://nextjs.org/


Nest.js

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-02-22 23:36  xgqfrms  阅读(44)  评论(3编辑  收藏  举报