anchor: HostNode | null,
isSVG: boolean
): HostElement
+ setStaticContent?(node: HostElement, content: string): void
}
// Renderer Node can technically be any object in the context of core renderer
nextSibling: hostNextSibling,
setScopeId: hostSetScopeId = NOOP,
cloneNode: hostCloneNode,
- insertStaticContent: hostInsertStaticContent
+ insertStaticContent: hostInsertStaticContent,
+ setStaticContent: hostSetStaticContent
} = options
// Note: functions inside this closure should use `const xxx = () => {}`
case Static:
if (n1 == null) {
mountStaticNode(n2, container, anchor, isSVG)
- } // static nodes are noop on patch
+ } else if (__DEV__) {
+ // static nodes are only patched during dev for HMR
+ n2.el = n1.el
+ if (n2.children !== n1.children) {
+ hostSetStaticContent!(n2.el!, n2.children as string)
+ }
+ }
break
case Fragment:
processFragment(