MCPcopy Create free account
hub / github.com/reactjs/server-components-demo / renderReactTree

Function renderReactTree

server/api.server.js:89–101  ·  view source on GitHub ↗
(res, props)

Source from the content-addressed store, hash-verified

87);
88
89async function renderReactTree(res, props) {
90 await waitForWebpack();
91 const manifest = readFileSync(
92 path.resolve(__dirname, '../build/react-client-manifest.json'),
93 'utf8'
94 );
95 const moduleMap = JSON.parse(manifest);
96 const {pipe} = renderToPipeableStream(
97 React.createElement(ReactApp, props),
98 moduleMap
99 );
100 pipe(res);
101}
102
103function sendResponse(req, res, redirectToId) {
104 const location = JSON.parse(req.query.location);

Callers 1

sendResponseFunction · 0.85

Calls 1

waitForWebpackFunction · 0.85

Tested by

no test coverage detected