Skip to content

Commit a09f81f

Browse files
committed
only add third argument for custom elements
1 parent 232cf4a commit a09f81f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/svelte/src/compiler/phases/3-transform/client/transform-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export function client_component(analysis, options) {
381381

382382
component_block.body.unshift(
383383
b.stmt(
384-
b.call('$.append_styles', b.id('$$anchor'), b.id('$$css'), b.literal(options.customElement))
384+
b.call('$.append_styles', b.id('$$anchor'), b.id('$$css'), options.customElement && b.true)
385385
)
386386
);
387387
}

packages/svelte/src/internal/client/dom/css.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ var seen = new Set();
66
/**
77
* @param {Node} anchor
88
* @param {{ hash: string, code: string }} css
9-
* @param {boolean} is_custom_element
9+
* @param {boolean} [is_custom_element]
1010
*/
11-
export function append_styles(anchor, css, is_custom_element) {
11+
export function append_styles(anchor, css, is_custom_element = false) {
1212
// in dev, always check the DOM, so that styles can be replaced with HMR
1313
if (!DEV && !is_custom_element) {
1414
if (seen.has(css)) return;

0 commit comments

Comments
 (0)