Files
Sebastian Markbåge 64d4b84204 Rename Flight to Transport (#18808)
* Rename Flight to Transport

Flight is still the codename for the implementation details (like Fiber).

However, now the public package is react-transport-... which is only
intended to be used directly by integrators.

* Rename names
2020-05-03 11:33:48 -07:00

27 lines
530 B
JavaScript

'use strict';
const ReactTransportDOMServer = require('react-transport-dom-webpack/server');
const React = require('react');
const Stream = require('stream');
function Text({children}) {
return <span>{children}</span>;
}
function HTML() {
return (
<div>
<Text>Hello</Text>
<Text>world</Text>
</div>
);
}
module.exports = function(req, res) {
res.setHeader('Access-Control-Allow-Origin', '*');
let model = {
content: <HTML />,
};
ReactTransportDOMServer.pipeToNodeWritable(model, res);
};