oc-template-react-compiler 6.5.1 → 6.5.2

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.
Files changed (2) hide show
  1. package/dist/lib/hmr.js +7 -1
  2. package/package.json +1 -1
package/dist/lib/hmr.js CHANGED
@@ -13,6 +13,9 @@ const appBlock = ({ name, version, entry }) => `
13
13
  window.__$$oc_initialData__ = Object.freeze(data);
14
14
  window.__$$oc_Settings__ = Object.freeze({ baseUrl: '/', id: 'root', name: '${name}', staticPath: '/', version: '${version}' });
15
15
 
16
+ window.oc = window.oc || {};
17
+ window.oc.cmd = window.oc.cmd || [];
18
+
16
19
  import App from "${entry}";
17
20
  import React from 'react';
18
21
  import { createRoot } from 'react-dom/client';
@@ -20,7 +23,10 @@ const appBlock = ({ name, version, entry }) => `
20
23
  const app = React.createElement(App, data);
21
24
  const container = document.getElementById('root');
22
25
  const root = createRoot(container);
23
- root.render(app);
26
+
27
+ window.oc.cmd.push(() => {
28
+ root.render(app);
29
+ });
24
30
  </script>
25
31
  `;
26
32
  exports.appBlock = appBlock;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oc-template-react-compiler",
3
- "version": "6.5.1",
3
+ "version": "6.5.2",
4
4
  "description": "Compiler for the React OC template",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",