Skip to content

Commit 0f25fc0

Browse files
committed
Ensure we do things correctly in finish effect handoff
1 parent e5196e5 commit 0f25fc0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/react/runtime/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function startComponentEffect(
113113
prevStore: EffectStore | undefined,
114114
nextStore: EffectStore
115115
) {
116-
nextStore._sub = prevStore ? prevStore._sub : Signal.prototype._subscribe;
116+
nextStore._sub = prevStore ? prevStore._sub : realSubscribe;
117117
Signal.prototype._subscribe = function (this: Signal, node: any) {
118118
nextStore._subscribers.push({ signal: this, node });
119119
};
@@ -128,7 +128,7 @@ function finishComponentEffect(
128128
prevStore: EffectStore | undefined,
129129
endEffect: () => void
130130
) {
131-
Signal.prototype._subscribe = this._sub;
131+
Signal.prototype._subscribe = prevStore ? prevStore._sub : realSubscribe;
132132
endEffect();
133133
currentStore = prevStore;
134134
}

0 commit comments

Comments
 (0)