Browse Source

[Docs] document optional param for renderComponentToString

main
Cheng Lou 11 years ago
parent
commit
d85ea4ab7b
  1. 9
      docs/ref-01-top-level-api.md

9
docs/ref-01-top-level-api.md

@ -104,3 +104,12 @@ string renderComponentToString(ReactComponent component)
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.
If you call `React.renderComponent()` 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.
### React.renderComponentToStaticMarkup
```javascript
string renderComponentToStaticMarkup(ReactComponent component)
```
Similar to `renderComponentToString`, 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.

Loading…
Cancel
Save