diff --git a/src/generators/nodes/Component.ts b/src/generators/nodes/Component.ts index 1f4ce88d85..b7d0d54c54 100644 --- a/src/generators/nodes/Component.ts +++ b/src/generators/nodes/Component.ts @@ -339,6 +339,7 @@ export default class Component extends Node { this.handlers.forEach(handler => { handler.var = block.getUniqueName(`${this.var}_${handler.name}`); // TODO this is hacky handler.render(compiler, block); + if (handler.usesContext) block.maintainContext = true; // TODO is there a better place to put this? }); if (this.name === 'svelte:component') {