We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25ebe3a commit c70913bCopy full SHA for c70913b
packages/runtime-core/src/renderer.ts
@@ -498,8 +498,14 @@ function baseCreateRenderer(
498
anchor,
499
)
500
} else {
501
- const el = (n2.el = n1.el!)
+ let el = (n2.el = n1.el!)
502
if (n2.children !== n1.children) {
503
+ // we don't inherit text node for cached text nodes in `traverseStaticChildren`
504
+ // but it maybe changed during HMR updates, so we need to handle this case by
505
+ // creating a new text node.
506
+ if (__DEV__ && isHmrUpdating && n2.patchFlag === PatchFlags.CACHED) {
507
+ el = hostCreateText(n2.children as string)
508
+ }
509
hostSetText(el, n2.children as string)
510
}
511
0 commit comments