@trycourier/courier-react 8.0.8-beta → 8.0.9-beta
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/renderer/legacy.d.ts +0 -4
- package/dist/renderer/modern.d.ts +0 -4
- package/dist/renderer/renderer.d.ts +0 -5
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef, useEffect } from "react";
|
|
1
|
+
import React, { version, useRef, useEffect } from "react";
|
|
2
2
|
import require$$1 from "object-assign";
|
|
3
3
|
import ReactDOM, { flushSync } from "react-dom";
|
|
4
4
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -6444,6 +6444,7 @@ function requireJsxRuntime() {
|
|
|
6444
6444
|
return jsxRuntime.exports;
|
|
6445
6445
|
}
|
|
6446
6446
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
6447
|
+
const reactVersion = parseInt(version.split(".")[0]);
|
|
6447
6448
|
function reactNodeToHTMLElement(node) {
|
|
6448
6449
|
const container = document.createElement("div");
|
|
6449
6450
|
flushSync(() => {
|
|
@@ -6452,10 +6453,13 @@ function reactNodeToHTMLElement(node) {
|
|
|
6452
6453
|
return container;
|
|
6453
6454
|
}
|
|
6454
6455
|
function render(node, container) {
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6456
|
+
if (reactVersion >= 18) {
|
|
6457
|
+
import("react-dom/client").then(({ createRoot }) => {
|
|
6458
|
+
if (createRoot instanceof Function) {
|
|
6459
|
+
const root = createRoot(container);
|
|
6460
|
+
return root.render(node);
|
|
6461
|
+
}
|
|
6462
|
+
});
|
|
6459
6463
|
}
|
|
6460
6464
|
const render2 = ReactDOM["render"];
|
|
6461
6465
|
return render2(node, container);
|