diff --git a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts index bc6e451631..83430a86f9 100644 --- a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts +++ b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts @@ -542,15 +542,9 @@ export default class InlineComponentWrapper extends Wrapper { `); } - if (parent_node) { - block.chunks.destroy.unshift(b` - @destroy_component(${name}, detaching); - `); - } else { - block.chunks.destroy.push(b` - @destroy_component(${name}, ${parent_node ? null : 'detaching'}); - `); - } + block.chunks.destroy[parent_node ? 'unshift' : 'push'](b` + @destroy_component(${name}, detaching); + `); block.chunks.outro.push( b`@transition_out(${name}.$$.fragment, #local);`