diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index 4274d233eb..fe4c43c5fe 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -156,7 +156,11 @@ export default function dom( () => { return { ${component.vars.filter(prop => prop.writable).map(prop => prop.name).join(", ")} }; } - ` : null; + ` : deindent` + () => { + return {} + } + `; inject_state = (uses_props || writable_props.length > 0) ? deindent` ${$$props} => { @@ -165,7 +169,11 @@ export default function dom( if ('${prop.name}' in $$props) ${component.invalidate(prop.name, `${prop.name} = ${$$props}.${prop.name}`)}; `)} } - ` : null; + ` : deindent` + ${$$props} => { + return + } + `; } // instrument assignments