4
4
Connect to an Atlas App Services App - React Native SDK
5
5
=======================================================
6
6
7
+ .. contents:: On this page
8
+ :local:
9
+ :backlinks: none
10
+ :depth: 2
11
+ :class: singlecol
12
+
7
13
Overview
8
14
--------
9
15
@@ -28,19 +34,9 @@ To set up your App client, pass the App ID string
28
34
to the ``id`` prop of the ``AppProvider``.
29
35
Wrap any components that need to access the App with the ``AppProvider``.
30
36
31
- .. tabs-realm-languages::
32
-
33
- .. tab::
34
- :tabid: typescript
35
-
36
- .. literalinclude:: /examples/generated/react-native/ts/app-provider.test.snippet.app-provider.tsx
37
- :language: typescript
38
-
39
- .. tab::
40
- :tabid: javascript
41
37
42
- .. literalinclude:: /examples/generated/react-native/js/app-provider.test.snippet.app-provider.jsx
43
- :language: javascript
38
+ .. literalinclude:: /examples/generated/react-native/js/app-provider.test.snippet.app-provider.jsx
39
+ :language: javascript
44
40
45
41
.. _react-native-app-retrieve-client:
46
42
@@ -51,19 +47,8 @@ All components wrapped within an ``AppProvider`` can access the :js-sdk:`App <Re
51
47
client with the ``useApp()`` hook. Using the App, you can authenticate users
52
48
and access App Services.
53
49
54
- .. tabs-realm-languages::
55
-
56
- .. tab::
57
- :tabid: typescript
58
-
59
- .. literalinclude:: /examples/generated/react-native/ts/use-app.test.snippet.use-app.tsx
60
- :language: typescript
61
-
62
- .. tab::
63
- :tabid: javascript
64
-
65
- .. literalinclude:: /examples/generated/react-native/js/use-app.test.snippet.use-app.jsx
66
- :language: javascript
50
+ .. literalinclude:: /examples/generated/react-native/js/use-app.test.snippet.use-app.jsx
51
+ :language: javascript
67
52
68
53
.. _react-native-retrieve-client-outside-provider:
69
54
@@ -74,21 +59,8 @@ To retrieve an instance of the App Client from anywhere in your application,
74
59
instantiate a new instance of :js-sdk:`Realm.App() <Realm.App.html>`
75
60
from the ``realm`` package, then pass in your ``App ID``.
76
61
62
+ .. code-block:: javascript
77
63
78
- .. tabs-realm-languages::
79
-
80
- .. tab::
81
- :tabid: typescript
82
-
83
- .. code-block:: typescript
84
- import Realm from "realm";
85
-
86
- const app = new Realm.App("<Your App ID>");
87
-
88
- .. tab::
89
- :tabid: javascript
90
-
91
- .. code-block:: javascript
92
- import Realm from "realm";
64
+ import Realm from "realm";
93
65
94
- const app = Realm.App.getApp("<Your App ID>");
66
+ const app = Realm.App.getApp("<Your App ID>");
0 commit comments