Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function respondWithApp(
App,
props,
res,
path,
docID,
clientAgent,
clientScriptID,
) {
res.set("content-type", "text/html");
// Horrible horrible horrible hacks to support react native web styles:
const appKey = `App-${docID}-${path}`;
const appKeys = AppRegistry.getAppKeys();
if (appKeys.indexOf(appKey) === -1) {
AppRegistry.registerComponent(appKey, () => App);
}
const { element, getStyleElement } = AppRegistry.getApplication(appKey, {
initialProps: props,
});
const appHtml = ReactDOMServer.renderToString(element);
const css = ReactDOMServer.renderToStaticMarkup(getStyleElement());
const title = App.title;
const html = `