diff options
author | Vitaly Takmazov | 2022-10-29 20:52:48 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:58 +0300 |
commit | 1d6708b0f034d3e9fbddc20247a281856350fc6c (patch) | |
tree | d5e106f59a15d781bcd00d72ebf2c7e18dccefa8 /vnext/src/index.js | |
parent | 4853133a62c8fd9406de320e33bd1fcd1678a7c2 (diff) |
Disable Suspense/lazy import to fix SSR
Diffstat (limited to 'vnext/src/index.js')
-rw-r--r-- | vnext/src/index.js | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/vnext/src/index.js b/vnext/src/index.js index 9f9fa4a3..59365d37 100644 --- a/vnext/src/index.js +++ b/vnext/src/index.js @@ -1,29 +1,20 @@ -import { StrictMode, lazy, Suspense } from 'react'; +import { StrictMode } from 'react'; import { hydrateRoot } from 'react-dom/client'; import { BrowserRouter } from 'react-router-dom'; import { CookiesProvider } from 'react-cookie'; import './index.css'; +import Juick from './App'; -function LoadingView() { - return ( - <div id="content"> - <div className="lds-ripple"><div></div><div></div></div> - </div> - ); -} - -const Juick = lazy(() => import('./App')); +const props = window.__PROPS__ ? JSON.parse(window.atob(window.__PROPS__)) : {}; const JuickApp = () => ( <StrictMode> - <Suspense fallback={LoadingView()}> - <CookiesProvider> - <BrowserRouter> - <Juick /> - </BrowserRouter> - </CookiesProvider> - </Suspense> + <CookiesProvider> + <BrowserRouter> + <Juick {...props} /> + </BrowserRouter> + </CookiesProvider> </StrictMode> ); |