@betterstore/react 0.3.64 → 0.3.65
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/CHANGELOG.md +6 -0
- package/dist/index.cjs.js +11 -3
- package/dist/index.mjs +11 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -560,14 +560,22 @@ const IframeWrapper = ({ children, iframeRef, wrapperRef, }) => {
|
|
|
560
560
|
iframe.addEventListener("load", onLoad);
|
|
561
561
|
window.addEventListener("resize", updateHeight);
|
|
562
562
|
return () => {
|
|
563
|
-
var _a
|
|
563
|
+
var _a;
|
|
564
564
|
iframe.removeEventListener("load", onLoad);
|
|
565
565
|
window.removeEventListener("resize", updateHeight);
|
|
566
566
|
if ((_a = styleRef.current) === null || _a === void 0 ? void 0 : _a.parentNode) {
|
|
567
567
|
styleRef.current.parentNode.removeChild(styleRef.current);
|
|
568
568
|
}
|
|
569
|
-
|
|
570
|
-
reactRootRef.current
|
|
569
|
+
// Safely unmount the root
|
|
570
|
+
if (reactRootRef.current) {
|
|
571
|
+
try {
|
|
572
|
+
reactRootRef.current.unmount();
|
|
573
|
+
}
|
|
574
|
+
catch (error) {
|
|
575
|
+
console.warn("Error during root unmount:", error);
|
|
576
|
+
}
|
|
577
|
+
reactRootRef.current = null;
|
|
578
|
+
}
|
|
571
579
|
};
|
|
572
580
|
}, [iframeRef, children]);
|
|
573
581
|
return (React.createElement("div", { ref: wrapperRef, style: {
|
package/dist/index.mjs
CHANGED
|
@@ -537,14 +537,22 @@ const IframeWrapper = ({ children, iframeRef, wrapperRef, }) => {
|
|
|
537
537
|
iframe.addEventListener("load", onLoad);
|
|
538
538
|
window.addEventListener("resize", updateHeight);
|
|
539
539
|
return () => {
|
|
540
|
-
var _a
|
|
540
|
+
var _a;
|
|
541
541
|
iframe.removeEventListener("load", onLoad);
|
|
542
542
|
window.removeEventListener("resize", updateHeight);
|
|
543
543
|
if ((_a = styleRef.current) === null || _a === void 0 ? void 0 : _a.parentNode) {
|
|
544
544
|
styleRef.current.parentNode.removeChild(styleRef.current);
|
|
545
545
|
}
|
|
546
|
-
|
|
547
|
-
reactRootRef.current
|
|
546
|
+
// Safely unmount the root
|
|
547
|
+
if (reactRootRef.current) {
|
|
548
|
+
try {
|
|
549
|
+
reactRootRef.current.unmount();
|
|
550
|
+
}
|
|
551
|
+
catch (error) {
|
|
552
|
+
console.warn("Error during root unmount:", error);
|
|
553
|
+
}
|
|
554
|
+
reactRootRef.current = null;
|
|
555
|
+
}
|
|
548
556
|
};
|
|
549
557
|
}, [iframeRef, children]);
|
|
550
558
|
return (React__default.createElement("div", { ref: wrapperRef, style: {
|