-
Notifications
You must be signed in to change notification settings - Fork 16
/
App.js
26 lines (22 loc) · 719 Bytes
/
App.js
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
import React from 'react'
const AppAdapter = React.lazy(() =>
import(/*webpackChunkName: 'app-adapter'*/ '@dhis2/app-adapter')
)
const D2App = React.lazy(() =>
import(/*webpackChunkName: 'app'*/ './current-d2-app/app')
) // Automatic bundle splitting!
const appConfig = {
url:
process.env.REACT_APP_DHIS2_BASE_URL ||
window.localStorage.DHIS2_BASE_URL,
appName: process.env.REACT_APP_DHIS2_APP_NAME || '',
apiVersion: parseInt(process.env.REACT_APP_DHIS2_API_VERSION) || 32,
}
const App = () => (
<React.Suspense fallback={<div />}>
<AppAdapter {...appConfig}>
<D2App config={appConfig} />
</AppAdapter>
</React.Suspense>
)
export default App