@@ -28,16 +28,19 @@ To set up your App client, pass the App ID string
28
28
to the ``id`` prop of the ``AppProvider``.
29
29
Wrap any components that need to access the App with the ``AppProvider``.
30
30
31
- TODO: new literalinclues for both examples
31
+ .. tabs-realm-languages::
32
32
33
- .. literalinclude:: /examples/generated/expo/AppWrapper.snippet.wrap-app-within-app-provider.tsx
34
- :language: typescript
35
- :emphasize-lines: 1, 5
33
+ .. tab::
34
+ :tabid: typescript
36
35
37
- You can also include additional configuration in the ``AppProvider`` by passing
38
- the properties of :js-sdk:`Realm.AppConfiguration <Realm.AppConfiguration.html>` as props.
36
+ .. literalinclude:: /examples/generated/react-native/ts/app-provider.test.snippet.app-provider.tsx
37
+ :language: typescript
39
38
40
- TODO: literalincludes for both examples
39
+ .. tab::
40
+ :tabid: javascript
41
+
42
+ .. literalinclude:: /examples/generated/react-native/js/app-provider.test.snippet.app-provider.jsx
43
+ :language: javascript
41
44
42
45
.. _react-native-app-retrieve-client:
43
46
@@ -48,15 +51,40 @@ All components wrapped within an ``AppProvider`` can access the :js-sdk:`App <Re
48
51
client with the ``useApp()`` hook. Using the App, you can authenticate users
49
52
and access App Services.
50
53
51
- TODO: literalincludes for both examples
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
52
61
53
- .. literalinclude:: /examples/generated/expo/LoginComponent.snippet.useApp-hook-usage.tsx
54
- :language: typescript
55
- :emphasize-lines: 1, 7, 11
62
+ .. tab::
63
+ :tabid: javascript
64
+
65
+ .. literalinclude:: /examples/generated/react-native/js/use-app.test.snippet.use-app.jsx
66
+ :language: javascript
56
67
57
68
.. _react-native-retrieve-client-outside-provider:
58
69
59
70
Retrieve App Outside the App Provider
60
71
-------------------------------------
61
72
62
- TODO: i don't fully grok this
73
+ To retrieve an instance of the App Client from anywhere in your application,
74
+ call :js-sdk:`Realm.App.getApp() <Realm.App.html#getApp>` and pass in your ``App ID``.
75
+
76
+ .. tabs-realm-languages::
77
+
78
+ .. tab::
79
+ :tabid: typescript
80
+
81
+ .. code-block:: typescript
82
+
83
+ const app = Realm.App.getApp("<Your App ID>");
84
+
85
+ .. tab::
86
+ :tabid: javascript
87
+
88
+ .. code-block:: javascript
89
+
90
+ const app = Realm.App.getApp("<Your App ID>");
0 commit comments