-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathApp.tsx
34 lines (30 loc) · 1.51 KB
/
App.tsx
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
34
import { MedplumClient } from '@medplum/core';
import { ExpoClientStorage, initWebSocketManager, polyfillMedplumWebAPIs } from '@medplum/expo-polyfills';
import { MedplumProvider } from '@medplum/react-hooks';
import Home from './Home';
// This is a module to get the Medplum client working on React Native by polyfilling a few Web APIs that are missing from the React Native runtime
// On web, the polyfill function is loaded but nothing is replaced
polyfillMedplumWebAPIs();
const medplum = new MedplumClient({
// Enter your Medplum connection details here
// See MedplumClient docs for more details
baseUrl: 'http://localhost:8103',
// ------------------------------------------------------------------------------
// If you are testing this out with your physical Android / iOS device and not an emulator,
// you will need to put your computer's local IP address here, for example:
// baseUrl: 'http://192.168.x.x:8103'
// Metro will usually emit this address in the line: 'Metro waiting on exp://192.168.1.216:8081'
// but you will need to change the protocol to 'http://' and the port to 8103 (the Medplum server's default) or whatever port your server is using
// ------------------------------------------------------------------------------
// clientId: 'MY_CLIENT_ID',
// projectId: 'MY_PROJECT_ID',
storage: new ExpoClientStorage(),
});
initWebSocketManager(medplum);
export default function App(): JSX.Element {
return (
<MedplumProvider medplum={medplum}>
<Home />
</MedplumProvider>
);
}