Skip to content

Commit 5e2cda3

Browse files
committed
simplify
1 parent e705a67 commit 5e2cda3

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/svelte/src/internal/client/dom/blocks/css-props.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@ export function css_props(node, is_html, props, component) {
1414
/** @type {HTMLElement | SVGElement} */
1515
let element;
1616

17-
/** @type {Comment} */
18-
let anchor;
19-
2017
/** @type {Text | Comment} */
2118
let component_anchor;
2219

2320
if (hydrating) {
2421
// Hydration: css props element is surrounded by a ssr comment ...
2522
element = /** @type {HTMLElement | SVGElement} */ (node);
2623

27-
anchor = /** @type {Comment} */ (element.nextSibling);
28-
2924
// ... and the child(ren) of the css props element is also surround by a ssr comment
3025
component_anchor = /** @type {Comment} */ (
3126
hydrate_anchor(/** @type {Comment} */ (element.firstChild))
@@ -38,9 +33,7 @@ export function css_props(node, is_html, props, component) {
3833
element = document.createElementNS(namespace_svg, 'g');
3934
}
4035

41-
anchor = /** @type {Comment} */ (node);
42-
43-
anchor.before(element);
36+
node.before(element); // TODO do we even need an anchor? Can we just pass in the correct element directly from the template?
4437
component_anchor = element.appendChild(empty());
4538
}
4639

0 commit comments

Comments
 (0)