aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/index.js
blob: be2dfeb1e326354afcbb0ad8853e5e292a5d7dc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { StrictMode, lazy, Suspense } from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from "react-router-dom";
import { CompatRouter } from "react-router-dom-v5-compat";
import { CookiesProvider } from 'react-cookie';

import './index.css';

function LoadingView() {
    return (
        <div id="content">
            <div className="lds-ripple"><div></div><div></div></div>
        </div>
    );
}

const Juick = lazy(() => import('./App'));

const JuickApp = () => (
    <StrictMode>
        <Suspense fallback={LoadingView()}>
            <CookiesProvider>
                <BrowserRouter>
                    <CompatRouter>
                        <Juick />
                    </CompatRouter>
                </BrowserRouter>
            </CookiesProvider>
        </Suspense>
    </StrictMode>
);

ReactDOM.hydrate(<JuickApp />, document.getElementById('app'));