mirror of
https://github.com/namibia/awesome-cheatsheets.git
synced 2024-12-19 00:42:03 +00:00
React Final Cheatsheet
This commit is contained in:
parent
c31f42ef9b
commit
6bfa05d8ae
29
frontend/react.js
vendored
29
frontend/react.js
vendored
@ -222,6 +222,35 @@ ReactDOM.findDOMNode(component)
|
|||||||
ReactDOM.createPortal(child, container)
|
ReactDOM.createPortal(child, container)
|
||||||
|
|
||||||
|
|
||||||
|
/* *******************************************************************************************
|
||||||
|
* REACTDOMSERVER
|
||||||
|
* The ReactDOMServer object enables you to render components to static markup.
|
||||||
|
* https://reactjs.org/docs/react-dom.html
|
||||||
|
* ******************************************************************************************* */
|
||||||
|
|
||||||
|
|
||||||
|
// Render a React element to its initial HTML. React will return an HTML string.
|
||||||
|
// You can use this method to generate HTML on the server and send the markup down on the initial
|
||||||
|
// request for faster page loads and to allow search engines to crawl your pages for SEO purposes.
|
||||||
|
ReactDOMServer.renderToString(element)
|
||||||
|
|
||||||
|
// Similar to renderToString, except this doesn’t create extra DOM attributes that React uses
|
||||||
|
// internally, such as data-reactroot. This is useful if you want to use React as a simple static
|
||||||
|
// page generator, as stripping away the extra attributes can save some bytes.
|
||||||
|
ReactDOMServer.renderToStaticMarkup(element)
|
||||||
|
|
||||||
|
// Render a React element to its initial HTML. Returns a Readable stream that outputs an HTML string.
|
||||||
|
// The HTML output by this stream is exactly equal to what ReactDOMServer.renderToString would return.
|
||||||
|
// You can use this method to generate HTML on the server and send the markup down on the initial
|
||||||
|
// request for faster page loads and to allow search engines to crawl your pages for SEO purposes.
|
||||||
|
ReactDOMServer.renderToNodeStream(element)
|
||||||
|
|
||||||
|
// Similar to renderToNodeStream, except this doesn’t create extra DOM attributes that React uses
|
||||||
|
// internally, such as data-reactroot. This is useful if you want to use React as a simple static
|
||||||
|
// page generator, as stripping away the extra attributes can save some bytes.
|
||||||
|
ReactDOMServer.renderToStaticNodeStream(element)
|
||||||
|
|
||||||
|
|
||||||
/* *******************************************************************************************
|
/* *******************************************************************************************
|
||||||
* TYPECHECKING WITH PROPTYPES
|
* TYPECHECKING WITH PROPTYPES
|
||||||
* https://reactjs.org/docs/typechecking-with-proptypes.html
|
* https://reactjs.org/docs/typechecking-with-proptypes.html
|
||||||
|
Loading…
Reference in New Issue
Block a user