@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.65
4
+
5
+ ### Patch Changes
6
+
7
+ - pe bug fix
8
+
3
9
  ## 0.3.64
4
10
 
5
11
  ### Patch Changes
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, _b;
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
- (_b = reactRootRef.current) === null || _b === void 0 ? void 0 : _b.unmount();
570
- reactRootRef.current = null;
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, _b;
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
- (_b = reactRootRef.current) === null || _b === void 0 ? void 0 : _b.unmount();
547
- reactRootRef.current = null;
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/react",
3
- "version": "0.3.64",
3
+ "version": "0.3.65",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {