Skip to content

Commit

Permalink
Use vnode._dom (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock authored Feb 15, 2025
1 parent ad95a9b commit 6a0284c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-lions-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@preact/signals": patch
---

Avoid usage of `.base` and check the `_dom` on the vnode instead
4 changes: 2 additions & 2 deletions packages/preact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ function SignalValue(this: AugmentedComponent, { data }: { data: Signal }) {
// undefined before mounting or a non-text node. In both of those cases
// the update gets handled by a full rerender.
const value = wrappedSignal.value;
if (self.base && self.base.nodeType === 3) {
(self.base as Text).data = value;
if (self.__v && self.__v.__e && self.__v.__e.nodeType === 3) {
(self.__v.__e as Text).data = value;
}
}
});
Expand Down

0 comments on commit 6a0284c

Please sign in to comment.