forked from webpack/webpack.js.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.jsx
28 lines (23 loc) · 745 Bytes
/
index.jsx
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
// Import External Dependencies
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import AnalyticsRouter from './AnalyticsRouter.jsx';
import App from './App.jsx';
import './styles/tailwind.css';
// Import helpers
import isClient from './utilities/is-client';
import { HelmetProvider } from 'react-helmet-async';
const isProduction = process.env.NODE_ENV === 'production';
const Router = isProduction ? AnalyticsRouter : BrowserRouter;
const render = isProduction ? ReactDOM.hydrate : ReactDOM.render;
// Client Side Rendering
if (isClient) {
render(
<Router id="UA-46921629-2">
<HelmetProvider>
<App />
</HelmetProvider>
</Router>,
document.getElementById('root')
);
}