Skip to content

Commit 10b4bb0

Browse files
author
Jay Jamero
committed
revert nodestream
1 parent 6867cac commit 10b4bb0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

render.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ var Component = function Component(pathToSource) {
5959
}
6060
};
6161

62-
Component.prototype.render = function render(props, toStaticMarkup) {
62+
Component.prototype.render = function render(props, toStaticMarkup, callback) {
6363
var element = this.factory(props);
6464
if (toStaticMarkup) {
65-
return ReactDOMServer.renderToStaticNodeStream(element);
65+
callback(ReactDOMServer.renderToStaticMarkup(element));
6666
} else {
67-
return ReactDOMServer.renderToNodeStream(element);
67+
callback(ReactDOMServer.renderToString(element));
6868
}
6969
};
7070

@@ -89,9 +89,9 @@ app.post('/render', function service(request, response) {
8989
}
9090
var component = cache[pathToSource];
9191

92-
var stream = component.render(props, toStaticMarkup);
93-
stream.on('error', function(err) {errorHandler(err, request, response)});
94-
stream.pipe(response);
92+
component.render(props, toStaticMarkup, function(output) {
93+
response.send(output);
94+
});
9595
});
9696

9797
function errorHandler(err, request, response, next) {

0 commit comments

Comments
 (0)