@trycourier/courier-react 8.0.7-beta → 8.0.8-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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +170 -183
- package/dist/index.mjs.map +1 -1
- package/dist/utils/utils.d.ts +4 -1
- package/package.json +1 -1
- package/dist/legacy-O6WN3SMx.mjs +0 -18
- package/dist/legacy-O6WN3SMx.mjs.map +0 -1
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Converts React node to HTMLElement
|
|
3
|
+
* Converts a React node to an HTMLElement.
|
|
4
|
+
* This function uses flushSync to ensure the DOM is updated synchronously.
|
|
5
|
+
* @param node - The React node to convert.
|
|
6
|
+
* @returns The converted HTMLElement.
|
|
4
7
|
*/
|
|
5
8
|
export declare function reactNodeToHTMLElement(node: ReactNode): HTMLElement;
|
package/package.json
CHANGED
package/dist/legacy-O6WN3SMx.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as ReactDOM from "react-dom";
|
|
2
|
-
import { flushSync } from "react-dom";
|
|
3
|
-
class LegacyRenderer {
|
|
4
|
-
static render(node, container) {
|
|
5
|
-
if ("render" in ReactDOM) {
|
|
6
|
-
ReactDOM.render(node, container);
|
|
7
|
-
} else {
|
|
8
|
-
const root = ReactDOM.createRoot(container);
|
|
9
|
-
flushSync(() => {
|
|
10
|
-
root.render(node);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
LegacyRenderer as default
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=legacy-O6WN3SMx.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-O6WN3SMx.mjs","sources":["../src/renderer/legacy.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { flushSync } from 'react-dom';\n\nexport default class LegacyRenderer {\n\n public static render(node: ReactNode, container: HTMLElement) {\n // Use the render method from ReactDOM if available, otherwise fallback to createRoot\n if ('render' in ReactDOM) {\n (ReactDOM as any).render(node, container);\n } else {\n const root = (ReactDOM as any).createRoot(container);\n flushSync(() => {\n root.render(node);\n });\n }\n }\n\n}"],"names":[],"mappings":";;AAIA,MAAqB,eAAe;AAAA,EAElC,OAAc,OAAO,MAAiB,WAAwB;AAE5D,QAAI,YAAY,UAAU;AACvB,eAAiB,OAAO,MAAM,SAAS;AAAA,IAAA,OACnC;AACC,YAAA,OAAQ,SAAiB,WAAW,SAAS;AACnD,gBAAU,MAAM;AACd,aAAK,OAAO,IAAI;AAAA,MAAA,CACjB;AAAA,IAAA;AAAA,EACH;AAGJ;"}
|