From e8065eb22e6db806702b379c3b027b14bc96dfcd Mon Sep 17 00:00:00 2001 From: Ivan Hofer Date: Fri, 20 Nov 2020 07:56:28 +0100 Subject: [PATCH] don't save customStyleTag in component.$$ --- src/runtime/internal/Component.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts index 52ab54fa8d..cd7c68a3eb 100644 --- a/src/runtime/internal/Component.ts +++ b/src/runtime/internal/Component.ts @@ -98,11 +98,11 @@ function make_dirty(component, i) { } -export function add_css_to_component(component, add_css, options) { - component.$$ = { - customStyleTag: options.customStyleTag || current_component && current_component.$$.customStyleTag - }; - add_css(component.$$.customStyleTag || document.head); +let appendStylesTo = document.head; + +export function add_css_to_component(add_css, { customStyleTag }) { + if (customStyleTag) appendStylesTo = customStyleTag; + add_css(appendStylesTo); } export function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { @@ -112,8 +112,6 @@ export function init(component, options, instance, create_fragment, not_equal, p const prop_values = options.props || {}; const $$: T$$ = component.$$ = { - ...component.$$, - fragment: null, ctx: null,