pull/16748/head
S. Elliott Johnson 4 weeks ago
parent 903f1f1c08
commit d694c57e8c

@ -5,7 +5,7 @@ import * as e from './internal/server/errors.js';
/** @param {() => void} fn */
export function onDestroy(fn) {
/** @type {SSRContext} */ (ssr_context).r.on_destroy(fn);
/** @type {SSRContext} */ (ssr_context).r?.on_destroy(fn);
}
export {

@ -74,6 +74,7 @@ export function render(component, options = {}) {
if (options.context) {
push();
/** @type {SSRContext} */ (ssr_context).c = options.context;
/** @type {SSRContext} */ (ssr_context).r = payload;
}
// @ts-expect-error
@ -98,7 +99,7 @@ export function render(component, options = {}) {
return {
head,
html: body,
body: body
body
};
} finally {
abort();
@ -127,6 +128,7 @@ export async function render_async(component, options = {}) {
if (options.context) {
push();
/** @type {SSRContext} */ (ssr_context).c = options.context;
/** @type {SSRContext} */ (ssr_context).r = payload;
}
// @ts-expect-error
@ -151,7 +153,7 @@ export async function render_async(component, options = {}) {
return {
head,
html: body,
body: body
body
};
} finally {
abort();

Loading…
Cancel
Save