Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-ads-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@preact/signals": patch
---

Fix issue where unmounted vnodes could update with signals
3 changes: 3 additions & 0 deletions packages/preact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ Component.prototype.shouldComponentUpdate = function (
props,
state
) {
// Suspended vnodes should always update:
if (this.__R) return true;

// @todo: Once preactjs/preact#3671 lands, this could just use `currentUpdater`:
const updater = this._updater;
const hasSignals = updater && updater._sources !== undefined;
Expand Down
2 changes: 2 additions & 0 deletions packages/preact/src/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export interface AugmentedElement extends HTMLElement {
}

export interface AugmentedComponent extends Component<any, any> {
// onResolve --> Preact indicator for suspended subtrees
__R?: boolean;
// hasScuFromHooks
// Preact 10.12 - Preact 10.25
u?: boolean;
Expand Down