File tree 1 file changed +4
-2
lines changed
packages/svelte/src/legacy 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export function asClassComponent(component) {
53
53
54
54
class Svelte4Component {
55
55
/** @type {any } */
56
- #events = { } ;
56
+ #events;
57
57
58
58
/** @type {Record<string, any> } */
59
59
#instance;
@@ -70,7 +70,7 @@ class Svelte4Component {
70
70
// Using proxy state here isn't completely mirroring the Svelte 4 behavior, because mutations to a property
71
71
// cause fine-grained updates to only the places where that property is used, and not the entire property.
72
72
// Reactive statements and actions (the things where this matters) are handling this properly regardless, so it should be fine in practise.
73
- const props = proxy ( { ...( options . props || { } ) , $$events : this . #events } , false ) ;
73
+ const props = proxy ( { ...( options . props || { } ) , $$events : { } } , false ) ;
74
74
this . #instance = ( options . hydrate ? hydrate : mount ) ( options . component , {
75
75
target : options . target ,
76
76
props,
@@ -79,6 +79,8 @@ class Svelte4Component {
79
79
recover : options . recover
80
80
} ) ;
81
81
82
+ this . #events = props . $$events ;
83
+
82
84
for ( const key of Object . keys ( this . #instance) ) {
83
85
if ( key === '$set' || key === '$destroy' || key === '$on' ) continue ;
84
86
define_property ( this , key , {
You can’t perform that action at this time.
0 commit comments