Skip to content

Commit 167f54c

Browse files
aickingaearon
authored andcommitted
Documentation: added info about streaming character encoding. (#10039)
1 parent c01d306 commit 167f54c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/docs/reference-react-dom-node-stream.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Render a React element to its initial HTML. This should only be used in Node.js;
3131

3232
If you call [`ReactDOM.render()`](/react/docs/react-dom.html#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.
3333

34+
Note that the stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text.
35+
3436
* * *
3537

3638
### `renderToStaticStream()`
@@ -40,3 +42,5 @@ ReactDOMNodeStream.renderToStaticStream(element)
4042
```
4143

4244
Similar to [`renderToStream`](#rendertostream), except this doesn't create extra DOM attributes such as `data-reactid`, 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.
45+
46+
Note that the stream returned from this method will return a byte stream encoded in utf-8. If you need a stream in another encoding, take a look a project like [iconv-lite](https://www.npmjs.com/package/iconv-lite), which provides transform streams for transcoding text.

0 commit comments

Comments
 (0)