Skip to content

Commit 0a146eb

Browse files
authored
Updated renderToNodeStream and renderToStaticNodeStream
Added additional parameters and examples for those parameters
1 parent 52c7885 commit 0a146eb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,29 @@ ReactCC.renderToStaticMarkup(<App />, cache);
132132
### renderToNodeStream
133133
- `component`: The React component being rendered
134134
- `cache`: The component cache
135+
- `res`: The response object that Express provides
136+
- `htmlStart`: Start of html markup in string form
137+
- `htmlEnd`: End of html markup in string form
135138
- `memLife`: (*Only if using Memcached*) An integer representing the lifetime (in seconds) of each Memcached entry. Defaults to 0.
136139

137140
**Example:**
138141
```javascript
139-
ReactCC.renderToNodeStream(<App />, cache);
142+
let htmlStart = '<html><head><title>Page</title></head><body><div id="react-root">';
143+
let htmlEnd = '</div></body></html>';
144+
ReactCC.renderToNodeStream(<App />, cache, res, htmlStart, htmlEnd);
140145
```
141146

142147
### renderToStaticNodeStream
143148
- `component`: The React component being rendered
144149
- `cache`: The component cache
150+
- `res`: The response object that Express provides
151+
- `htmlStart`: Start of html markup in string form
152+
- `htmlEnd`: End of html markup in string form
145153
- `memLife`: (*Only if using Memcached*) An integer representing the lifetime (in seconds) of each Memcached entry. Defaults to 0.
146154

147155
**Example:**
148156
```javascript
149-
ReactCC.renderToStaticNodeStream(<App />, cache);
157+
let htmlStart = '<html><head><title>Page</title></head><body><div id="react-root">';
158+
let htmlEnd = '</div></body></html>';
159+
ReactCC.renderToStaticNodeStream(<App />, cache, res, htmlStart, htmlEnd);
150160
```

0 commit comments

Comments
 (0)