Skip to content

Commit a41bdb6

Browse files
authored
fix: check that component wasn't instantiated (#10466)
fixes #10454
1 parent 3e8d4fd commit a41bdb6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/gentle-owls-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: check that component wasn't instantiated in `connectedCallback`

packages/svelte/src/runtime/internal/Component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ if (typeof HTMLElement === 'function') {
227227
if (!this.$$c) {
228228
// We wait one tick to let possible child slot elements be created/mounted
229229
await Promise.resolve();
230-
if (!this.$$cn) {
230+
if (!this.$$cn || this.$$c) {
231231
return;
232232
}
233233
function create_slot(name) {

0 commit comments

Comments
 (0)