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 renderFunction(ctx: Context) {
const logger = getLogger(ctx) || console;
const assets = getAssets(ctx);
const networkManager = new NetworkManager({
headers: ctx.headers,
cookies: ctx.request.headers.cookie || '',
});
const htmlManager = new HtmlManager();
const asyncAssetManager = new AsyncAssetManager();
const hydrationManager = new HydrationManager();
function Providers({children}: {children: React.ReactElement}) {
return (
{children}
return async function render(ctx: RenderContext) {
const app = renderFunction(ctx);
const networkManager = new NetworkManager();
const htmlManager = new HtmlManager();
try {
await extract(app, {
decorate(app) {
return (
{app}
);
},
});
} catch (error) {
logger.error(error);