Skip to content

Commit 2f22abe

Browse files
committed
Ensure we do things correctly in finish effect handoff
1 parent 54f6443 commit 2f22abe

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
@@ -108,7 +108,7 @@ function startComponentEffect(
108108
prevStore: EffectStore | undefined,
109109
nextStore: EffectStore
110110
) {
111-
nextStore._sub = prevStore ? prevStore._sub : Signal.prototype._subscribe;
111+
nextStore._sub = prevStore ? prevStore._sub : realSubscribe;
112112
Signal.prototype._subscribe = function (this: Signal, node: any) {
113113
nextStore._subscribers.push({ signal: this, node });
114114
};
@@ -123,7 +123,7 @@ function finishComponentEffect(
123123
prevStore: EffectStore | undefined,
124124
endEffect: () => void
125125
) {
126-
Signal.prototype._subscribe = this._sub;
126+
Signal.prototype._subscribe = prevStore ? prevStore._sub : realSubscribe;
127127
endEffect();
128128
currentStore = prevStore;
129129
}

0 commit comments

Comments
 (0)