Skip to content

Commit

Permalink
add to legacy wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Dec 18, 2024
1 parent c723222 commit 75e1dea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/svelte/src/legacy/legacy-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ export { createClassComponent };
*/
export function asClassComponent(component) {
const component_constructor = as_class_component(component);
/** @type {(props?: {}, opts?: { $$slots?: {}; context?: Map<any, any>; }) => { html: any; css: { code: string; map: any; }; head: string; } } */
/** @type {(props?: {}, opts?: { $$slots?: {}; context?: Map<any, any>; }) => { html: any; css: { code: string; map: any; }; head: string; htmlAttributes: string } } */
const _render = (props, { context } = {}) => {
// @ts-expect-error the typings are off, but this will work if the component is compiled in SSR mode
const result = render(component, { props, context });
return {
css: { code: '', map: null },
head: result.head,
html: result.body
html: result.body,
htmlAttributes: result.htmlAttributes
};
};
// @ts-expect-error this is present for SSR
Expand Down

0 comments on commit 75e1dea

Please sign in to comment.