@getpara/wagmi-v2-integration 2.0.0-dev.4 → 2.0.0-dev.6

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.js CHANGED
@@ -59,7 +59,14 @@ import { createParaConnector } from "@getpara/wagmi-v2-connector";
59
59
  import { ParaProvider, setIsOpen } from "@getpara/react-sdk";
60
60
  import { jsx } from "react/jsx-runtime";
61
61
  var Portal;
62
+ var Root;
62
63
  function renderModal(para, modalProps, onCloseArg) {
64
+ const existingContainer = document.getElementById("para-modal");
65
+ const container = existingContainer != null ? existingContainer : document.createElement("div");
66
+ container.id = "para-modal";
67
+ if (!existingContainer) {
68
+ document.body.appendChild(container);
69
+ }
63
70
  const onClose = () => {
64
71
  onCloseArg();
65
72
  modalProps.onClose && modalProps.onClose();
@@ -80,12 +87,17 @@ function renderModal(para, modalProps, onCloseArg) {
80
87
  );
81
88
  try {
82
89
  const { createPortal } = yield import("react-dom");
90
+ const { createRoot } = yield import("react-dom/client");
83
91
  if (!Portal) {
84
- Portal = createPortal(Modal, document.body);
92
+ Portal = createPortal(Modal, container);
85
93
  }
94
+ if (!Root) {
95
+ Root = createRoot(document.body);
96
+ }
97
+ Root.render(Portal);
86
98
  } catch (e) {
87
99
  const ReactDOM = yield import("react-dom");
88
- ReactDOM.createPortal(Modal, document.body);
100
+ ReactDOM.render(Modal, container);
89
101
  }
90
102
  });
91
103
  render();
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/wagmi-v2-integration",
3
- "version": "2.0.0-dev.4",
3
+ "version": "2.0.0-dev.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",