@lwc/engine-core 6.4.3 → 6.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -5089,7 +5089,16 @@ function s(slotName, data, children, slotset) {
5089
5089
  // to the vnode because the current way the diffing algo works, it will replace the original reference
5090
5090
  // to the host element with a new one. This means the new element will be mounted and immediately unmounted.
5091
5091
  // Creating a copy of the vnode to preserve a reference to the previous host element.
5092
- clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
5092
+ if (shared.isUndefined(vnode.elm)) {
5093
+ // vnode.elm is undefined during initial render.
5094
+ // We don't need to clone at this point because it doesn't need to be unmounted.
5095
+ vnode.slotAssignment = data.slotAssignment;
5096
+ }
5097
+ else {
5098
+ // Clone when the vnode.elm is defined to ensure we don't lose reference to the previous element.
5099
+ // This is specifically for slot forwarding.
5100
+ clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
5101
+ }
5093
5102
  }
5094
5103
  // If the slot content is standard type, the content is static, no additional
5095
5104
  // processing needed on the vnode
@@ -7847,5 +7856,5 @@ exports.swapTemplate = swapTemplate;
7847
7856
  exports.track = track;
7848
7857
  exports.unwrap = unwrap;
7849
7858
  exports.wire = wire;
7850
- /** version: 6.4.3 */
7859
+ /** version: 6.4.5 */
7851
7860
  //# sourceMappingURL=index.cjs.js.map