@samitouri / QOS-React-2 / commits / 9c3357eef5

Update React.renderToString argument type in docs

renderToString and renderToStaticMarkup now take a ReactElement. Update the documentation to reflect this recent change.

Ville Immonen committed Nov 4, 2014 at 16:49 UTC 9c3357eef5f1968e78d77eea8e75722d70856303
1 file changed +3 -3
docs/docs/ref-01-top-level-api.md
+3 -3
@@ -57,10 +57,10 @@ Remove a mounted React component from the DOM and clean up its event handlers an
57 ### React.renderToString
58
59 ```javascript
60 -string renderToString(ReactComponent component)
60 +string renderToString(ReactElement element)
61 ```
62
63 -Render a component to its initial HTML. This should only be used on the server. 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.
63 +Render a ReactElement to its initial HTML. This should only be used on the server. 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.
64
65 If you call `React.render()` on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience.
66
@@ -68,7 +68,7 @@ If you call `React.render()` on a node that already has this server-rendered mar
68 ### React.renderToStaticMarkup
69
70 ```javascript
71 -string renderToStaticMarkup(ReactComponent component)
71 +string renderToStaticMarkup(ReactElement element)
72 ```
73
74 Similar to `renderToString`, except this doesn't create extra DOM attributes such as `data-react-id`, that React uses internally. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save lots of bytes.