MCPcopy Index your code
hub / github.com/react/react / renderApp

Function renderApp

fixtures/flight-esm/server/region.js:32–42  ·  view source on GitHub ↗
(res, returnValue)

Source from the content-addressed store, hash-verified

30const moduleBasePath = new URL('../src', url.pathToFileURL(__filename)).href;
31
32async function renderApp(res, returnValue) {
33 const {renderToPipeableStream} = await import('react-server-dom-esm/server');
34 const m = await import('../src/App.js');
35
36 const App = m.default;
37 const root = React.createElement(App);
38 // For client-invoked server actions we refresh the tree and return a return value.
39 const payload = returnValue ? {returnValue, root} : root;
40 const {pipe} = renderToPipeableStream(payload, moduleBasePath);
41 pipe(res);
42}
43
44app.get('/', async function (req, res) {
45 await renderApp(res, null);

Callers 1

region.jsFile · 0.70

Calls 2

renderToPipeableStreamFunction · 0.50
pipeFunction · 0.50

Tested by

no test coverage detected