aboutsummaryrefslogtreecommitdiff
path: root/vnext
diff options
context:
space:
mode:
Diffstat (limited to 'vnext')
-rw-r--r--vnext/src/index.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/vnext/src/index.js b/vnext/src/index.js
index fd5024c9..11a78a48 100644
--- a/vnext/src/index.js
+++ b/vnext/src/index.js
@@ -9,7 +9,7 @@ import 'core-js/modules/es.symbol';
import 'core-js/modules/web.dom-collections.iterator';
import 'url-polyfill';
import { StrictMode, lazy } from 'react';
-import { hydrateRoot } from 'react-dom/client';
+import { createRoot, hydrateRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { CookiesProvider } from 'react-cookie';
@@ -40,4 +40,9 @@ const JuickApp = () => (
</StrictMode>
);
-hydrateRoot(document.getElementById('app'), <JuickApp />);
+let root = document.getElementById('app');
+if (window.__PROPS__) {
+ hydrateRoot(root, <JuickApp />);
+} else {
+ createRoot(root).render(<JuickApp />);
+}